From 15f4329cf7cffe267eda685911c276c4b8fcfcc0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 30 Sep 2019 16:19:43 -0700 Subject: [PATCH] feat: .d.ts for protos (#451) --- .github/release-please.yml | 0 .kokoro/continuous/node10/test.cfg | 28 - .kokoro/test.sh | 9 - protos/protos.d.ts | 45235 +++++++++++ protos/protos.js | 112526 ++++++++++++++++++++++++++ synth.metadata | 10 +- 6 files changed, 157766 insertions(+), 42 deletions(-) create mode 100644 .github/release-please.yml create mode 100644 protos/protos.d.ts create mode 100644 protos/protos.js diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..e69de29b diff --git a/.kokoro/continuous/node10/test.cfg b/.kokoro/continuous/node10/test.cfg index fefee48b..468b8c71 100644 --- a/.kokoro/continuous/node10/test.cfg +++ b/.kokoro/continuous/node10/test.cfg @@ -7,31 +7,3 @@ before_action { } } } - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/.kokoro/test.sh b/.kokoro/test.sh index da1443e7..9db11bb0 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -35,12 +35,3 @@ if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then else echo "coverage is only reported for Node $COVERAGE_NODE" fi - -# if release-please keys set, we kick off a task to update the release-PR. -if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then - npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ - --repo-url=googleapis/nodejs-vision \ - --package-name=@google-cloud/vision \ - --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ - --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please -fi diff --git a/protos/protos.d.ts b/protos/protos.d.ts new file mode 100644 index 00000000..0885d8d3 --- /dev/null +++ b/protos/protos.d.ts @@ -0,0 +1,45235 @@ +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace vision. */ + namespace vision { + + /** Namespace v1. */ + namespace v1 { + + /** Represents an ImageAnnotator */ + class ImageAnnotator extends $protobuf.rpc.Service { + + /** + * Constructs a new ImageAnnotator 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 ImageAnnotator 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): ImageAnnotator; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + */ + public batchAnnotateImages(request: google.cloud.vision.v1.IBatchAnnotateImagesRequest, callback: google.cloud.vision.v1.ImageAnnotator.BatchAnnotateImagesCallback): void; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @returns Promise + */ + public batchAnnotateImages(request: google.cloud.vision.v1.IBatchAnnotateImagesRequest): Promise; + + /** + * Calls BatchAnnotateFiles. + * @param request BatchAnnotateFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchAnnotateFilesResponse + */ + public batchAnnotateFiles(request: google.cloud.vision.v1.IBatchAnnotateFilesRequest, callback: google.cloud.vision.v1.ImageAnnotator.BatchAnnotateFilesCallback): void; + + /** + * Calls BatchAnnotateFiles. + * @param request BatchAnnotateFilesRequest message or plain object + * @returns Promise + */ + public batchAnnotateFiles(request: google.cloud.vision.v1.IBatchAnnotateFilesRequest): Promise; + + /** + * Calls AsyncBatchAnnotateImages. + * @param request AsyncBatchAnnotateImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public asyncBatchAnnotateImages(request: google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, callback: google.cloud.vision.v1.ImageAnnotator.AsyncBatchAnnotateImagesCallback): void; + + /** + * Calls AsyncBatchAnnotateImages. + * @param request AsyncBatchAnnotateImagesRequest message or plain object + * @returns Promise + */ + public asyncBatchAnnotateImages(request: google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest): Promise; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, callback: google.cloud.vision.v1.ImageAnnotator.AsyncBatchAnnotateFilesCallback): void; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @returns Promise + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest): Promise; + } + + namespace ImageAnnotator { + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#batchAnnotateImages}. + * @param error Error, if any + * @param [response] BatchAnnotateImagesResponse + */ + type BatchAnnotateImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1.BatchAnnotateImagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#batchAnnotateFiles}. + * @param error Error, if any + * @param [response] BatchAnnotateFilesResponse + */ + type BatchAnnotateFilesCallback = (error: (Error|null), response?: google.cloud.vision.v1.BatchAnnotateFilesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#asyncBatchAnnotateImages}. + * @param error Error, if any + * @param [response] Operation + */ + type AsyncBatchAnnotateImagesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @param error Error, if any + * @param [response] Operation + */ + type AsyncBatchAnnotateFilesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Feature. */ + interface IFeature { + + /** Feature type */ + type?: (google.cloud.vision.v1.Feature.Type|null); + + /** Feature maxResults */ + maxResults?: (number|null); + + /** Feature model */ + model?: (string|null); + } + + /** Represents a Feature. */ + class Feature implements IFeature { + + /** + * Constructs a new Feature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IFeature); + + /** Feature type. */ + public type: google.cloud.vision.v1.Feature.Type; + + /** Feature maxResults. */ + public maxResults: number; + + /** Feature model. */ + public model: string; + + /** + * Creates a new Feature instance using the specified properties. + * @param [properties] Properties to set + * @returns Feature instance + */ + public static create(properties?: google.cloud.vision.v1.IFeature): google.cloud.vision.v1.Feature; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Feature; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Feature; + + /** + * Verifies a Feature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Feature; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @param message Feature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Feature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Feature { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + FACE_DETECTION = 1, + LANDMARK_DETECTION = 2, + LOGO_DETECTION = 3, + LABEL_DETECTION = 4, + TEXT_DETECTION = 5, + DOCUMENT_TEXT_DETECTION = 11, + SAFE_SEARCH_DETECTION = 6, + IMAGE_PROPERTIES = 7, + CROP_HINTS = 9, + WEB_DETECTION = 10, + PRODUCT_SEARCH = 12, + OBJECT_LOCALIZATION = 19 + } + } + + /** Likelihood enum. */ + enum Likelihood { + UNKNOWN = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + + /** Properties of an ImageSource. */ + interface IImageSource { + + /** ImageSource gcsImageUri */ + gcsImageUri?: (string|null); + + /** ImageSource imageUri */ + imageUri?: (string|null); + } + + /** Represents an ImageSource. */ + class ImageSource implements IImageSource { + + /** + * Constructs a new ImageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImageSource); + + /** ImageSource gcsImageUri. */ + public gcsImageUri: string; + + /** ImageSource imageUri. */ + public imageUri: string; + + /** + * Creates a new ImageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageSource instance + */ + public static create(properties?: google.cloud.vision.v1.IImageSource): google.cloud.vision.v1.ImageSource; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImageSource; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImageSource; + + /** + * Verifies an ImageSource message. + * @param message Plain 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 ImageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImageSource; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @param message ImageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image content */ + content?: (Uint8Array|null); + + /** Image source */ + source?: (google.cloud.vision.v1.IImageSource|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImage); + + /** Image content. */ + public content: Uint8Array; + + /** Image source. */ + public source?: (google.cloud.vision.v1.IImageSource|null); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.vision.v1.IImage): google.cloud.vision.v1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.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.vision.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.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.vision.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.vision.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.vision.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.vision.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.vision.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FaceAnnotation. */ + interface IFaceAnnotation { + + /** FaceAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly */ + fdBoundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** FaceAnnotation landmarks */ + landmarks?: (google.cloud.vision.v1.FaceAnnotation.ILandmark[]|null); + + /** FaceAnnotation rollAngle */ + rollAngle?: (number|null); + + /** FaceAnnotation panAngle */ + panAngle?: (number|null); + + /** FaceAnnotation tiltAngle */ + tiltAngle?: (number|null); + + /** FaceAnnotation detectionConfidence */ + detectionConfidence?: (number|null); + + /** FaceAnnotation landmarkingConfidence */ + landmarkingConfidence?: (number|null); + + /** FaceAnnotation joyLikelihood */ + joyLikelihood?: (google.cloud.vision.v1.Likelihood|null); + + /** FaceAnnotation sorrowLikelihood */ + sorrowLikelihood?: (google.cloud.vision.v1.Likelihood|null); + + /** FaceAnnotation angerLikelihood */ + angerLikelihood?: (google.cloud.vision.v1.Likelihood|null); + + /** FaceAnnotation surpriseLikelihood */ + surpriseLikelihood?: (google.cloud.vision.v1.Likelihood|null); + + /** FaceAnnotation underExposedLikelihood */ + underExposedLikelihood?: (google.cloud.vision.v1.Likelihood|null); + + /** FaceAnnotation blurredLikelihood */ + blurredLikelihood?: (google.cloud.vision.v1.Likelihood|null); + + /** FaceAnnotation headwearLikelihood */ + headwearLikelihood?: (google.cloud.vision.v1.Likelihood|null); + } + + /** Represents a FaceAnnotation. */ + class FaceAnnotation implements IFaceAnnotation { + + /** + * Constructs a new FaceAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IFaceAnnotation); + + /** FaceAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly. */ + public fdBoundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** FaceAnnotation landmarks. */ + public landmarks: google.cloud.vision.v1.FaceAnnotation.ILandmark[]; + + /** FaceAnnotation rollAngle. */ + public rollAngle: number; + + /** FaceAnnotation panAngle. */ + public panAngle: number; + + /** FaceAnnotation tiltAngle. */ + public tiltAngle: number; + + /** FaceAnnotation detectionConfidence. */ + public detectionConfidence: number; + + /** FaceAnnotation landmarkingConfidence. */ + public landmarkingConfidence: number; + + /** FaceAnnotation joyLikelihood. */ + public joyLikelihood: google.cloud.vision.v1.Likelihood; + + /** FaceAnnotation sorrowLikelihood. */ + public sorrowLikelihood: google.cloud.vision.v1.Likelihood; + + /** FaceAnnotation angerLikelihood. */ + public angerLikelihood: google.cloud.vision.v1.Likelihood; + + /** FaceAnnotation surpriseLikelihood. */ + public surpriseLikelihood: google.cloud.vision.v1.Likelihood; + + /** FaceAnnotation underExposedLikelihood. */ + public underExposedLikelihood: google.cloud.vision.v1.Likelihood; + + /** FaceAnnotation blurredLikelihood. */ + public blurredLikelihood: google.cloud.vision.v1.Likelihood; + + /** FaceAnnotation headwearLikelihood. */ + public headwearLikelihood: google.cloud.vision.v1.Likelihood; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.IFaceAnnotation): google.cloud.vision.v1.FaceAnnotation; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.FaceAnnotation; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.FaceAnnotation; + + /** + * Verifies a FaceAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.FaceAnnotation; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @param message FaceAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.FaceAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FaceAnnotation { + + /** Properties of a Landmark. */ + interface ILandmark { + + /** Landmark type */ + type?: (google.cloud.vision.v1.FaceAnnotation.Landmark.Type|null); + + /** Landmark position */ + position?: (google.cloud.vision.v1.IPosition|null); + } + + /** Represents a Landmark. */ + class Landmark implements ILandmark { + + /** + * Constructs a new Landmark. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.FaceAnnotation.ILandmark); + + /** Landmark type. */ + public type: google.cloud.vision.v1.FaceAnnotation.Landmark.Type; + + /** Landmark position. */ + public position?: (google.cloud.vision.v1.IPosition|null); + + /** + * Creates a new Landmark instance using the specified properties. + * @param [properties] Properties to set + * @returns Landmark instance + */ + public static create(properties?: google.cloud.vision.v1.FaceAnnotation.ILandmark): google.cloud.vision.v1.FaceAnnotation.Landmark; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.FaceAnnotation.Landmark; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.FaceAnnotation.Landmark; + + /** + * Verifies a Landmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Landmark + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.FaceAnnotation.Landmark; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @param message Landmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.FaceAnnotation.Landmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Landmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Landmark { + + /** Type enum. */ + enum Type { + UNKNOWN_LANDMARK = 0, + LEFT_EYE = 1, + RIGHT_EYE = 2, + LEFT_OF_LEFT_EYEBROW = 3, + RIGHT_OF_LEFT_EYEBROW = 4, + LEFT_OF_RIGHT_EYEBROW = 5, + RIGHT_OF_RIGHT_EYEBROW = 6, + MIDPOINT_BETWEEN_EYES = 7, + NOSE_TIP = 8, + UPPER_LIP = 9, + LOWER_LIP = 10, + MOUTH_LEFT = 11, + MOUTH_RIGHT = 12, + MOUTH_CENTER = 13, + NOSE_BOTTOM_RIGHT = 14, + NOSE_BOTTOM_LEFT = 15, + NOSE_BOTTOM_CENTER = 16, + LEFT_EYE_TOP_BOUNDARY = 17, + LEFT_EYE_RIGHT_CORNER = 18, + LEFT_EYE_BOTTOM_BOUNDARY = 19, + LEFT_EYE_LEFT_CORNER = 20, + RIGHT_EYE_TOP_BOUNDARY = 21, + RIGHT_EYE_RIGHT_CORNER = 22, + RIGHT_EYE_BOTTOM_BOUNDARY = 23, + RIGHT_EYE_LEFT_CORNER = 24, + LEFT_EYEBROW_UPPER_MIDPOINT = 25, + RIGHT_EYEBROW_UPPER_MIDPOINT = 26, + LEFT_EAR_TRAGION = 27, + RIGHT_EAR_TRAGION = 28, + LEFT_EYE_PUPIL = 29, + RIGHT_EYE_PUPIL = 30, + FOREHEAD_GLABELLA = 31, + CHIN_GNATHION = 32, + CHIN_LEFT_GONION = 33, + CHIN_RIGHT_GONION = 34 + } + } + } + + /** Properties of a LocationInfo. */ + interface ILocationInfo { + + /** LocationInfo latLng */ + latLng?: (google.type.ILatLng|null); + } + + /** Represents a LocationInfo. */ + class LocationInfo implements ILocationInfo { + + /** + * Constructs a new LocationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ILocationInfo); + + /** LocationInfo latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** + * Creates a new LocationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationInfo instance + */ + public static create(properties?: google.cloud.vision.v1.ILocationInfo): google.cloud.vision.v1.LocationInfo; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.LocationInfo; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.LocationInfo; + + /** + * Verifies a LocationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.LocationInfo; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @param message LocationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Property. */ + interface IProperty { + + /** Property name */ + name?: (string|null); + + /** Property value */ + value?: (string|null); + + /** Property uint64Value */ + uint64Value?: (number|Long|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IProperty); + + /** Property name. */ + public name: string; + + /** Property value. */ + public value: string; + + /** Property uint64Value. */ + public uint64Value: (number|Long); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.vision.v1.IProperty): google.cloud.vision.v1.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Property message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Property; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Property; + + /** + * Verifies a Property message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Property + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Property; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @param message Property + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Property to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EntityAnnotation. */ + interface IEntityAnnotation { + + /** EntityAnnotation mid */ + mid?: (string|null); + + /** EntityAnnotation locale */ + locale?: (string|null); + + /** EntityAnnotation description */ + description?: (string|null); + + /** EntityAnnotation score */ + score?: (number|null); + + /** EntityAnnotation confidence */ + confidence?: (number|null); + + /** EntityAnnotation topicality */ + topicality?: (number|null); + + /** EntityAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** EntityAnnotation locations */ + locations?: (google.cloud.vision.v1.ILocationInfo[]|null); + + /** EntityAnnotation properties */ + properties?: (google.cloud.vision.v1.IProperty[]|null); + } + + /** Represents an EntityAnnotation. */ + class EntityAnnotation implements IEntityAnnotation { + + /** + * Constructs a new EntityAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IEntityAnnotation); + + /** EntityAnnotation mid. */ + public mid: string; + + /** EntityAnnotation locale. */ + public locale: string; + + /** EntityAnnotation description. */ + public description: string; + + /** EntityAnnotation score. */ + public score: number; + + /** EntityAnnotation confidence. */ + public confidence: number; + + /** EntityAnnotation topicality. */ + public topicality: number; + + /** EntityAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** EntityAnnotation locations. */ + public locations: google.cloud.vision.v1.ILocationInfo[]; + + /** EntityAnnotation properties. */ + public properties: google.cloud.vision.v1.IProperty[]; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.IEntityAnnotation): google.cloud.vision.v1.EntityAnnotation; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.EntityAnnotation; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.EntityAnnotation; + + /** + * Verifies an EntityAnnotation message. + * @param message Plain 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 EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.EntityAnnotation; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @param message EntityAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.EntityAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LocalizedObjectAnnotation. */ + interface ILocalizedObjectAnnotation { + + /** LocalizedObjectAnnotation mid */ + mid?: (string|null); + + /** LocalizedObjectAnnotation languageCode */ + languageCode?: (string|null); + + /** LocalizedObjectAnnotation name */ + name?: (string|null); + + /** LocalizedObjectAnnotation score */ + score?: (number|null); + + /** LocalizedObjectAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + } + + /** Represents a LocalizedObjectAnnotation. */ + class LocalizedObjectAnnotation implements ILocalizedObjectAnnotation { + + /** + * Constructs a new LocalizedObjectAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ILocalizedObjectAnnotation); + + /** LocalizedObjectAnnotation mid. */ + public mid: string; + + /** LocalizedObjectAnnotation languageCode. */ + public languageCode: string; + + /** LocalizedObjectAnnotation name. */ + public name: string; + + /** LocalizedObjectAnnotation score. */ + public score: number; + + /** LocalizedObjectAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** + * Creates a new LocalizedObjectAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalizedObjectAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.ILocalizedObjectAnnotation): google.cloud.vision.v1.LocalizedObjectAnnotation; + + /** + * Encodes the specified LocalizedObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1.LocalizedObjectAnnotation.verify|verify} messages. + * @param message LocalizedObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ILocalizedObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalizedObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.LocalizedObjectAnnotation.verify|verify} messages. + * @param message LocalizedObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ILocalizedObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.LocalizedObjectAnnotation; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.LocalizedObjectAnnotation; + + /** + * Verifies a LocalizedObjectAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalizedObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalizedObjectAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.LocalizedObjectAnnotation; + + /** + * Creates a plain object from a LocalizedObjectAnnotation message. Also converts values to other types if specified. + * @param message LocalizedObjectAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.LocalizedObjectAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalizedObjectAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SafeSearchAnnotation. */ + interface ISafeSearchAnnotation { + + /** SafeSearchAnnotation adult */ + adult?: (google.cloud.vision.v1.Likelihood|null); + + /** SafeSearchAnnotation spoof */ + spoof?: (google.cloud.vision.v1.Likelihood|null); + + /** SafeSearchAnnotation medical */ + medical?: (google.cloud.vision.v1.Likelihood|null); + + /** SafeSearchAnnotation violence */ + violence?: (google.cloud.vision.v1.Likelihood|null); + + /** SafeSearchAnnotation racy */ + racy?: (google.cloud.vision.v1.Likelihood|null); + + /** SafeSearchAnnotation adultConfidence */ + adultConfidence?: (number|null); + + /** SafeSearchAnnotation spoofConfidence */ + spoofConfidence?: (number|null); + + /** SafeSearchAnnotation medicalConfidence */ + medicalConfidence?: (number|null); + + /** SafeSearchAnnotation violenceConfidence */ + violenceConfidence?: (number|null); + + /** SafeSearchAnnotation racyConfidence */ + racyConfidence?: (number|null); + + /** SafeSearchAnnotation nsfwConfidence */ + nsfwConfidence?: (number|null); + } + + /** Represents a SafeSearchAnnotation. */ + class SafeSearchAnnotation implements ISafeSearchAnnotation { + + /** + * Constructs a new SafeSearchAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ISafeSearchAnnotation); + + /** SafeSearchAnnotation adult. */ + public adult: google.cloud.vision.v1.Likelihood; + + /** SafeSearchAnnotation spoof. */ + public spoof: google.cloud.vision.v1.Likelihood; + + /** SafeSearchAnnotation medical. */ + public medical: google.cloud.vision.v1.Likelihood; + + /** SafeSearchAnnotation violence. */ + public violence: google.cloud.vision.v1.Likelihood; + + /** SafeSearchAnnotation racy. */ + public racy: google.cloud.vision.v1.Likelihood; + + /** SafeSearchAnnotation adultConfidence. */ + public adultConfidence: number; + + /** SafeSearchAnnotation spoofConfidence. */ + public spoofConfidence: number; + + /** SafeSearchAnnotation medicalConfidence. */ + public medicalConfidence: number; + + /** SafeSearchAnnotation violenceConfidence. */ + public violenceConfidence: number; + + /** SafeSearchAnnotation racyConfidence. */ + public racyConfidence: number; + + /** SafeSearchAnnotation nsfwConfidence. */ + public nsfwConfidence: number; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns SafeSearchAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.ISafeSearchAnnotation): google.cloud.vision.v1.SafeSearchAnnotation; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.SafeSearchAnnotation; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.SafeSearchAnnotation; + + /** + * Verifies a SafeSearchAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafeSearchAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.SafeSearchAnnotation; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @param message SafeSearchAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.SafeSearchAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LatLongRect. */ + interface ILatLongRect { + + /** LatLongRect minLatLng */ + minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng */ + maxLatLng?: (google.type.ILatLng|null); + } + + /** Represents a LatLongRect. */ + class LatLongRect implements ILatLongRect { + + /** + * Constructs a new LatLongRect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ILatLongRect); + + /** LatLongRect minLatLng. */ + public minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng. */ + public maxLatLng?: (google.type.ILatLng|null); + + /** + * Creates a new LatLongRect instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLongRect instance + */ + public static create(properties?: google.cloud.vision.v1.ILatLongRect): google.cloud.vision.v1.LatLongRect; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.LatLongRect; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.LatLongRect; + + /** + * Verifies a LatLongRect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLongRect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.LatLongRect; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @param message LatLongRect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.LatLongRect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLongRect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo color */ + color?: (google.type.IColor|null); + + /** ColorInfo score */ + score?: (number|null); + + /** ColorInfo pixelFraction */ + pixelFraction?: (number|null); + } + + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { + + /** + * Constructs a new ColorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IColorInfo); + + /** ColorInfo color. */ + public color?: (google.type.IColor|null); + + /** ColorInfo score. */ + public score: number; + + /** ColorInfo pixelFraction. */ + public pixelFraction: number; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColorInfo instance + */ + public static create(properties?: google.cloud.vision.v1.IColorInfo): google.cloud.vision.v1.ColorInfo; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ColorInfo; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ColorInfo; + + /** + * Verifies a ColorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ColorInfo; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DominantColorsAnnotation. */ + interface IDominantColorsAnnotation { + + /** DominantColorsAnnotation colors */ + colors?: (google.cloud.vision.v1.IColorInfo[]|null); + } + + /** Represents a DominantColorsAnnotation. */ + class DominantColorsAnnotation implements IDominantColorsAnnotation { + + /** + * Constructs a new DominantColorsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IDominantColorsAnnotation); + + /** DominantColorsAnnotation colors. */ + public colors: google.cloud.vision.v1.IColorInfo[]; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns DominantColorsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.IDominantColorsAnnotation): google.cloud.vision.v1.DominantColorsAnnotation; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.DominantColorsAnnotation; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.DominantColorsAnnotation; + + /** + * Verifies a DominantColorsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DominantColorsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.DominantColorsAnnotation; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @param message DominantColorsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.DominantColorsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageProperties. */ + interface IImageProperties { + + /** ImageProperties dominantColors */ + dominantColors?: (google.cloud.vision.v1.IDominantColorsAnnotation|null); + } + + /** Represents an ImageProperties. */ + class ImageProperties implements IImageProperties { + + /** + * Constructs a new ImageProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImageProperties); + + /** ImageProperties dominantColors. */ + public dominantColors?: (google.cloud.vision.v1.IDominantColorsAnnotation|null); + + /** + * Creates a new ImageProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageProperties instance + */ + public static create(properties?: google.cloud.vision.v1.IImageProperties): google.cloud.vision.v1.ImageProperties; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImageProperties; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImageProperties; + + /** + * Verifies an ImageProperties message. + * @param message Plain 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 ImageProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImageProperties; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @param message ImageProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImageProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHint. */ + interface ICropHint { + + /** CropHint boundingPoly */ + boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** CropHint confidence */ + confidence?: (number|null); + + /** CropHint importanceFraction */ + importanceFraction?: (number|null); + } + + /** Represents a CropHint. */ + class CropHint implements ICropHint { + + /** + * Constructs a new CropHint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ICropHint); + + /** CropHint boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** CropHint confidence. */ + public confidence: number; + + /** CropHint importanceFraction. */ + public importanceFraction: number; + + /** + * Creates a new CropHint instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHint instance + */ + public static create(properties?: google.cloud.vision.v1.ICropHint): google.cloud.vision.v1.CropHint; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.CropHint; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.CropHint; + + /** + * Verifies a CropHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.CropHint; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @param message CropHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.CropHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsAnnotation. */ + interface ICropHintsAnnotation { + + /** CropHintsAnnotation cropHints */ + cropHints?: (google.cloud.vision.v1.ICropHint[]|null); + } + + /** Represents a CropHintsAnnotation. */ + class CropHintsAnnotation implements ICropHintsAnnotation { + + /** + * Constructs a new CropHintsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ICropHintsAnnotation); + + /** CropHintsAnnotation cropHints. */ + public cropHints: google.cloud.vision.v1.ICropHint[]; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.ICropHintsAnnotation): google.cloud.vision.v1.CropHintsAnnotation; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.CropHintsAnnotation; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.CropHintsAnnotation; + + /** + * Verifies a CropHintsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.CropHintsAnnotation; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @param message CropHintsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.CropHintsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsParams. */ + interface ICropHintsParams { + + /** CropHintsParams aspectRatios */ + aspectRatios?: (number[]|null); + } + + /** Represents a CropHintsParams. */ + class CropHintsParams implements ICropHintsParams { + + /** + * Constructs a new CropHintsParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ICropHintsParams); + + /** CropHintsParams aspectRatios. */ + public aspectRatios: number[]; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsParams instance + */ + public static create(properties?: google.cloud.vision.v1.ICropHintsParams): google.cloud.vision.v1.CropHintsParams; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.CropHintsParams; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.CropHintsParams; + + /** + * Verifies a CropHintsParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.CropHintsParams; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @param message CropHintsParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.CropHintsParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetectionParams. */ + interface IWebDetectionParams { + + /** WebDetectionParams includeGeoResults */ + includeGeoResults?: (boolean|null); + } + + /** Represents a WebDetectionParams. */ + class WebDetectionParams implements IWebDetectionParams { + + /** + * Constructs a new WebDetectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IWebDetectionParams); + + /** WebDetectionParams includeGeoResults. */ + public includeGeoResults: boolean; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetectionParams instance + */ + public static create(properties?: google.cloud.vision.v1.IWebDetectionParams): google.cloud.vision.v1.WebDetectionParams; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.WebDetectionParams; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.WebDetectionParams; + + /** + * Verifies a WebDetectionParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.WebDetectionParams; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @param message WebDetectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.WebDetectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageContext. */ + interface IImageContext { + + /** ImageContext latLongRect */ + latLongRect?: (google.cloud.vision.v1.ILatLongRect|null); + + /** ImageContext languageHints */ + languageHints?: (string[]|null); + + /** ImageContext cropHintsParams */ + cropHintsParams?: (google.cloud.vision.v1.ICropHintsParams|null); + + /** ImageContext productSearchParams */ + productSearchParams?: (google.cloud.vision.v1.IProductSearchParams|null); + + /** ImageContext webDetectionParams */ + webDetectionParams?: (google.cloud.vision.v1.IWebDetectionParams|null); + } + + /** Represents an ImageContext. */ + class ImageContext implements IImageContext { + + /** + * Constructs a new ImageContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImageContext); + + /** ImageContext latLongRect. */ + public latLongRect?: (google.cloud.vision.v1.ILatLongRect|null); + + /** ImageContext languageHints. */ + public languageHints: string[]; + + /** ImageContext cropHintsParams. */ + public cropHintsParams?: (google.cloud.vision.v1.ICropHintsParams|null); + + /** ImageContext productSearchParams. */ + public productSearchParams?: (google.cloud.vision.v1.IProductSearchParams|null); + + /** ImageContext webDetectionParams. */ + public webDetectionParams?: (google.cloud.vision.v1.IWebDetectionParams|null); + + /** + * Creates a new ImageContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageContext instance + */ + public static create(properties?: google.cloud.vision.v1.IImageContext): google.cloud.vision.v1.ImageContext; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImageContext; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImageContext; + + /** + * Verifies an ImageContext message. + * @param message Plain 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 ImageContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImageContext; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @param message ImageContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImageContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageRequest. */ + interface IAnnotateImageRequest { + + /** AnnotateImageRequest image */ + image?: (google.cloud.vision.v1.IImage|null); + + /** AnnotateImageRequest features */ + features?: (google.cloud.vision.v1.IFeature[]|null); + + /** AnnotateImageRequest imageContext */ + imageContext?: (google.cloud.vision.v1.IImageContext|null); + } + + /** Represents an AnnotateImageRequest. */ + class AnnotateImageRequest implements IAnnotateImageRequest { + + /** + * Constructs a new AnnotateImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAnnotateImageRequest); + + /** AnnotateImageRequest image. */ + public image?: (google.cloud.vision.v1.IImage|null); + + /** AnnotateImageRequest features. */ + public features: google.cloud.vision.v1.IFeature[]; + + /** AnnotateImageRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1.IImageContext|null); + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IAnnotateImageRequest): google.cloud.vision.v1.AnnotateImageRequest; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AnnotateImageRequest; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AnnotateImageRequest; + + /** + * Verifies an AnnotateImageRequest message. + * @param message Plain 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 AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AnnotateImageRequest; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @param message AnnotateImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AnnotateImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageAnnotationContext. */ + interface IImageAnnotationContext { + + /** ImageAnnotationContext uri */ + uri?: (string|null); + + /** ImageAnnotationContext pageNumber */ + pageNumber?: (number|null); + } + + /** Represents an ImageAnnotationContext. */ + class ImageAnnotationContext implements IImageAnnotationContext { + + /** + * Constructs a new ImageAnnotationContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImageAnnotationContext); + + /** ImageAnnotationContext uri. */ + public uri: string; + + /** ImageAnnotationContext pageNumber. */ + public pageNumber: number; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageAnnotationContext instance + */ + public static create(properties?: google.cloud.vision.v1.IImageAnnotationContext): google.cloud.vision.v1.ImageAnnotationContext; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImageAnnotationContext; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImageAnnotationContext; + + /** + * Verifies an ImageAnnotationContext message. + * @param message Plain 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 ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageAnnotationContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImageAnnotationContext; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @param message ImageAnnotationContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImageAnnotationContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageResponse. */ + interface IAnnotateImageResponse { + + /** AnnotateImageResponse faceAnnotations */ + faceAnnotations?: (google.cloud.vision.v1.IFaceAnnotation[]|null); + + /** AnnotateImageResponse landmarkAnnotations */ + landmarkAnnotations?: (google.cloud.vision.v1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse logoAnnotations */ + logoAnnotations?: (google.cloud.vision.v1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse labelAnnotations */ + labelAnnotations?: (google.cloud.vision.v1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse localizedObjectAnnotations */ + localizedObjectAnnotations?: (google.cloud.vision.v1.ILocalizedObjectAnnotation[]|null); + + /** AnnotateImageResponse textAnnotations */ + textAnnotations?: (google.cloud.vision.v1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse fullTextAnnotation */ + fullTextAnnotation?: (google.cloud.vision.v1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation */ + safeSearchAnnotation?: (google.cloud.vision.v1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation */ + imagePropertiesAnnotation?: (google.cloud.vision.v1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation */ + cropHintsAnnotation?: (google.cloud.vision.v1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection */ + webDetection?: (google.cloud.vision.v1.IWebDetection|null); + + /** AnnotateImageResponse productSearchResults */ + productSearchResults?: (google.cloud.vision.v1.IProductSearchResults|null); + + /** AnnotateImageResponse error */ + error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context */ + context?: (google.cloud.vision.v1.IImageAnnotationContext|null); + } + + /** Represents an AnnotateImageResponse. */ + class AnnotateImageResponse implements IAnnotateImageResponse { + + /** + * Constructs a new AnnotateImageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAnnotateImageResponse); + + /** AnnotateImageResponse faceAnnotations. */ + public faceAnnotations: google.cloud.vision.v1.IFaceAnnotation[]; + + /** AnnotateImageResponse landmarkAnnotations. */ + public landmarkAnnotations: google.cloud.vision.v1.IEntityAnnotation[]; + + /** AnnotateImageResponse logoAnnotations. */ + public logoAnnotations: google.cloud.vision.v1.IEntityAnnotation[]; + + /** AnnotateImageResponse labelAnnotations. */ + public labelAnnotations: google.cloud.vision.v1.IEntityAnnotation[]; + + /** AnnotateImageResponse localizedObjectAnnotations. */ + public localizedObjectAnnotations: google.cloud.vision.v1.ILocalizedObjectAnnotation[]; + + /** AnnotateImageResponse textAnnotations. */ + public textAnnotations: google.cloud.vision.v1.IEntityAnnotation[]; + + /** AnnotateImageResponse fullTextAnnotation. */ + public fullTextAnnotation?: (google.cloud.vision.v1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation. */ + public safeSearchAnnotation?: (google.cloud.vision.v1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation. */ + public imagePropertiesAnnotation?: (google.cloud.vision.v1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation. */ + public cropHintsAnnotation?: (google.cloud.vision.v1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection. */ + public webDetection?: (google.cloud.vision.v1.IWebDetection|null); + + /** AnnotateImageResponse productSearchResults. */ + public productSearchResults?: (google.cloud.vision.v1.IProductSearchResults|null); + + /** AnnotateImageResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context. */ + public context?: (google.cloud.vision.v1.IImageAnnotationContext|null); + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IAnnotateImageResponse): google.cloud.vision.v1.AnnotateImageResponse; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AnnotateImageResponse; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AnnotateImageResponse; + + /** + * Verifies an AnnotateImageResponse message. + * @param message Plain 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 AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AnnotateImageResponse; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @param message AnnotateImageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AnnotateImageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesRequest. */ + interface IBatchAnnotateImagesRequest { + + /** BatchAnnotateImagesRequest requests */ + requests?: (google.cloud.vision.v1.IAnnotateImageRequest[]|null); + + /** BatchAnnotateImagesRequest parent */ + parent?: (string|null); + } + + /** Represents a BatchAnnotateImagesRequest. */ + class BatchAnnotateImagesRequest implements IBatchAnnotateImagesRequest { + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IBatchAnnotateImagesRequest); + + /** BatchAnnotateImagesRequest requests. */ + public requests: google.cloud.vision.v1.IAnnotateImageRequest[]; + + /** BatchAnnotateImagesRequest parent. */ + public parent: string; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IBatchAnnotateImagesRequest): google.cloud.vision.v1.BatchAnnotateImagesRequest; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.BatchAnnotateImagesRequest; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.BatchAnnotateImagesRequest; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.BatchAnnotateImagesRequest; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.BatchAnnotateImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesResponse. */ + interface IBatchAnnotateImagesResponse { + + /** BatchAnnotateImagesResponse responses */ + responses?: (google.cloud.vision.v1.IAnnotateImageResponse[]|null); + } + + /** Represents a BatchAnnotateImagesResponse. */ + class BatchAnnotateImagesResponse implements IBatchAnnotateImagesResponse { + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IBatchAnnotateImagesResponse); + + /** BatchAnnotateImagesResponse responses. */ + public responses: google.cloud.vision.v1.IAnnotateImageResponse[]; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IBatchAnnotateImagesResponse): google.cloud.vision.v1.BatchAnnotateImagesResponse; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.BatchAnnotateImagesResponse; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.BatchAnnotateImagesResponse; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.BatchAnnotateImagesResponse; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.BatchAnnotateImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateFileRequest. */ + interface IAnnotateFileRequest { + + /** AnnotateFileRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1.IInputConfig|null); + + /** AnnotateFileRequest features */ + features?: (google.cloud.vision.v1.IFeature[]|null); + + /** AnnotateFileRequest imageContext */ + imageContext?: (google.cloud.vision.v1.IImageContext|null); + + /** AnnotateFileRequest pages */ + pages?: (number[]|null); + } + + /** Represents an AnnotateFileRequest. */ + class AnnotateFileRequest implements IAnnotateFileRequest { + + /** + * Constructs a new AnnotateFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAnnotateFileRequest); + + /** AnnotateFileRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1.IInputConfig|null); + + /** AnnotateFileRequest features. */ + public features: google.cloud.vision.v1.IFeature[]; + + /** AnnotateFileRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1.IImageContext|null); + + /** AnnotateFileRequest pages. */ + public pages: number[]; + + /** + * Creates a new AnnotateFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateFileRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IAnnotateFileRequest): google.cloud.vision.v1.AnnotateFileRequest; + + /** + * Encodes the specified AnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileRequest.verify|verify} messages. + * @param message AnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileRequest.verify|verify} messages. + * @param message AnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AnnotateFileRequest; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AnnotateFileRequest; + + /** + * Verifies an AnnotateFileRequest message. + * @param message Plain 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 AnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AnnotateFileRequest; + + /** + * Creates a plain object from an AnnotateFileRequest message. Also converts values to other types if specified. + * @param message AnnotateFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AnnotateFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateFileResponse. */ + interface IAnnotateFileResponse { + + /** AnnotateFileResponse inputConfig */ + inputConfig?: (google.cloud.vision.v1.IInputConfig|null); + + /** AnnotateFileResponse responses */ + responses?: (google.cloud.vision.v1.IAnnotateImageResponse[]|null); + + /** AnnotateFileResponse totalPages */ + totalPages?: (number|null); + + /** AnnotateFileResponse error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents an AnnotateFileResponse. */ + class AnnotateFileResponse implements IAnnotateFileResponse { + + /** + * Constructs a new AnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAnnotateFileResponse); + + /** AnnotateFileResponse inputConfig. */ + public inputConfig?: (google.cloud.vision.v1.IInputConfig|null); + + /** AnnotateFileResponse responses. */ + public responses: google.cloud.vision.v1.IAnnotateImageResponse[]; + + /** AnnotateFileResponse totalPages. */ + public totalPages: number; + + /** AnnotateFileResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IAnnotateFileResponse): google.cloud.vision.v1.AnnotateFileResponse; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AnnotateFileResponse; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AnnotateFileResponse; + + /** + * Verifies an AnnotateFileResponse message. + * @param message Plain 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 AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AnnotateFileResponse; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @param message AnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateFilesRequest. */ + interface IBatchAnnotateFilesRequest { + + /** BatchAnnotateFilesRequest requests */ + requests?: (google.cloud.vision.v1.IAnnotateFileRequest[]|null); + + /** BatchAnnotateFilesRequest parent */ + parent?: (string|null); + } + + /** Represents a BatchAnnotateFilesRequest. */ + class BatchAnnotateFilesRequest implements IBatchAnnotateFilesRequest { + + /** + * Constructs a new BatchAnnotateFilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IBatchAnnotateFilesRequest); + + /** BatchAnnotateFilesRequest requests. */ + public requests: google.cloud.vision.v1.IAnnotateFileRequest[]; + + /** BatchAnnotateFilesRequest parent. */ + public parent: string; + + /** + * Creates a new BatchAnnotateFilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateFilesRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IBatchAnnotateFilesRequest): google.cloud.vision.v1.BatchAnnotateFilesRequest; + + /** + * Encodes the specified BatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesRequest.verify|verify} messages. + * @param message BatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesRequest.verify|verify} messages. + * @param message BatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.BatchAnnotateFilesRequest; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.BatchAnnotateFilesRequest; + + /** + * Verifies a BatchAnnotateFilesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateFilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.BatchAnnotateFilesRequest; + + /** + * Creates a plain object from a BatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @param message BatchAnnotateFilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.BatchAnnotateFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateFilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateFilesResponse. */ + interface IBatchAnnotateFilesResponse { + + /** BatchAnnotateFilesResponse responses */ + responses?: (google.cloud.vision.v1.IAnnotateFileResponse[]|null); + } + + /** Represents a BatchAnnotateFilesResponse. */ + class BatchAnnotateFilesResponse implements IBatchAnnotateFilesResponse { + + /** + * Constructs a new BatchAnnotateFilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IBatchAnnotateFilesResponse); + + /** BatchAnnotateFilesResponse responses. */ + public responses: google.cloud.vision.v1.IAnnotateFileResponse[]; + + /** + * Creates a new BatchAnnotateFilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateFilesResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IBatchAnnotateFilesResponse): google.cloud.vision.v1.BatchAnnotateFilesResponse; + + /** + * Encodes the specified BatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesResponse.verify|verify} messages. + * @param message BatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesResponse.verify|verify} messages. + * @param message BatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.BatchAnnotateFilesResponse; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.BatchAnnotateFilesResponse; + + /** + * Verifies a BatchAnnotateFilesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateFilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.BatchAnnotateFilesResponse; + + /** + * Creates a plain object from a BatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @param message BatchAnnotateFilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.BatchAnnotateFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateFilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileRequest. */ + interface IAsyncAnnotateFileRequest { + + /** AsyncAnnotateFileRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features */ + features?: (google.cloud.vision.v1.IFeature[]|null); + + /** AsyncAnnotateFileRequest imageContext */ + imageContext?: (google.cloud.vision.v1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig */ + outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileRequest. */ + class AsyncAnnotateFileRequest implements IAsyncAnnotateFileRequest { + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAsyncAnnotateFileRequest); + + /** AsyncAnnotateFileRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features. */ + public features: google.cloud.vision.v1.IFeature[]; + + /** AsyncAnnotateFileRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig. */ + public outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IAsyncAnnotateFileRequest): google.cloud.vision.v1.AsyncAnnotateFileRequest; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AsyncAnnotateFileRequest; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AsyncAnnotateFileRequest; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @param message Plain 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 AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AsyncAnnotateFileRequest; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AsyncAnnotateFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileResponse. */ + interface IAsyncAnnotateFileResponse { + + /** AsyncAnnotateFileResponse outputConfig */ + outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileResponse. */ + class AsyncAnnotateFileResponse implements IAsyncAnnotateFileResponse { + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAsyncAnnotateFileResponse); + + /** AsyncAnnotateFileResponse outputConfig. */ + public outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IAsyncAnnotateFileResponse): google.cloud.vision.v1.AsyncAnnotateFileResponse; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AsyncAnnotateFileResponse; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AsyncAnnotateFileResponse; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @param message Plain 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 AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AsyncAnnotateFileResponse; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AsyncAnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateImagesRequest. */ + interface IAsyncBatchAnnotateImagesRequest { + + /** AsyncBatchAnnotateImagesRequest requests */ + requests?: (google.cloud.vision.v1.IAnnotateImageRequest[]|null); + + /** AsyncBatchAnnotateImagesRequest outputConfig */ + outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + + /** AsyncBatchAnnotateImagesRequest parent */ + parent?: (string|null); + } + + /** Represents an AsyncBatchAnnotateImagesRequest. */ + class AsyncBatchAnnotateImagesRequest implements IAsyncBatchAnnotateImagesRequest { + + /** + * Constructs a new AsyncBatchAnnotateImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest); + + /** AsyncBatchAnnotateImagesRequest requests. */ + public requests: google.cloud.vision.v1.IAnnotateImageRequest[]; + + /** AsyncBatchAnnotateImagesRequest outputConfig. */ + public outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + + /** AsyncBatchAnnotateImagesRequest parent. */ + public parent: string; + + /** + * Creates a new AsyncBatchAnnotateImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest): google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest; + + /** + * Verifies an AsyncBatchAnnotateImagesRequest message. + * @param message Plain 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 AsyncBatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateImagesResponse. */ + interface IAsyncBatchAnnotateImagesResponse { + + /** AsyncBatchAnnotateImagesResponse outputConfig */ + outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + } + + /** Represents an AsyncBatchAnnotateImagesResponse. */ + class AsyncBatchAnnotateImagesResponse implements IAsyncBatchAnnotateImagesResponse { + + /** + * Constructs a new AsyncBatchAnnotateImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse); + + /** AsyncBatchAnnotateImagesResponse outputConfig. */ + public outputConfig?: (google.cloud.vision.v1.IOutputConfig|null); + + /** + * Creates a new AsyncBatchAnnotateImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse): google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse; + + /** + * Verifies an AsyncBatchAnnotateImagesResponse message. + * @param message Plain 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 AsyncBatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesRequest. */ + interface IAsyncBatchAnnotateFilesRequest { + + /** AsyncBatchAnnotateFilesRequest requests */ + requests?: (google.cloud.vision.v1.IAsyncAnnotateFileRequest[]|null); + + /** AsyncBatchAnnotateFilesRequest parent */ + parent?: (string|null); + } + + /** Represents an AsyncBatchAnnotateFilesRequest. */ + class AsyncBatchAnnotateFilesRequest implements IAsyncBatchAnnotateFilesRequest { + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest); + + /** AsyncBatchAnnotateFilesRequest requests. */ + public requests: google.cloud.vision.v1.IAsyncAnnotateFileRequest[]; + + /** AsyncBatchAnnotateFilesRequest parent. */ + public parent: string; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest): google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @param message Plain 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 AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesResponse. */ + interface IAsyncBatchAnnotateFilesResponse { + + /** AsyncBatchAnnotateFilesResponse responses */ + responses?: (google.cloud.vision.v1.IAsyncAnnotateFileResponse[]|null); + } + + /** Represents an AsyncBatchAnnotateFilesResponse. */ + class AsyncBatchAnnotateFilesResponse implements IAsyncBatchAnnotateFilesResponse { + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse); + + /** AsyncBatchAnnotateFilesResponse responses. */ + public responses: google.cloud.vision.v1.IAsyncAnnotateFileResponse[]; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse): google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @param message Plain 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 AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.vision.v1.IGcsSource|null); + + /** InputConfig content */ + content?: (Uint8Array|null); + + /** InputConfig mimeType */ + mimeType?: (string|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.vision.v1.IGcsSource|null); + + /** InputConfig content. */ + public content: Uint8Array; + + /** InputConfig mimeType. */ + public mimeType: string; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.vision.v1.IInputConfig): google.cloud.vision.v1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.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.vision.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.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.vision.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.vision.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.vision.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.vision.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.vision.v1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.vision.v1.IGcsDestination|null); + + /** OutputConfig batchSize */ + batchSize?: (number|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.vision.v1.IGcsDestination|null); + + /** OutputConfig batchSize. */ + public batchSize: number; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.vision.v1.IOutputConfig): google.cloud.vision.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.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.vision.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.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.vision.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.vision.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.vision.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.vision.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.vision.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource uri */ + uri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IGcsSource); + + /** GcsSource uri. */ + public uri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.vision.v1.IGcsSource): google.cloud.vision.v1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.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.vision.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.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.vision.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.vision.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.vision.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.vision.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.vision.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 uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.vision.v1.IGcsDestination): google.cloud.vision.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.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.vision.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.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.vision.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.vision.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.vision.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.vision.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.vision.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata state */ + state?: (google.cloud.vision.v1.OperationMetadata.State|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 OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IOperationMetadata); + + /** OperationMetadata state. */ + public state: google.cloud.vision.v1.OperationMetadata.State; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.vision.v1.IOperationMetadata): google.cloud.vision.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATED = 1, + RUNNING = 2, + DONE = 3, + CANCELLED = 4 + } + } + + /** Properties of a Vertex. */ + interface IVertex { + + /** Vertex x */ + x?: (number|null); + + /** Vertex y */ + y?: (number|null); + } + + /** Represents a Vertex. */ + class Vertex implements IVertex { + + /** + * Constructs a new Vertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IVertex); + + /** Vertex x. */ + public x: number; + + /** Vertex y. */ + public y: number; + + /** + * Creates a new Vertex instance using the specified properties. + * @param [properties] Properties to set + * @returns Vertex instance + */ + public static create(properties?: google.cloud.vision.v1.IVertex): google.cloud.vision.v1.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Vertex; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Vertex; + + /** + * Verifies a Vertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Vertex; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @param message Vertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vertex 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.vision.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.vision.v1.INormalizedVertex): google.cloud.vision.v1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.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.vision.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.vision.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.vision.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.vision.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.vision.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.vision.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.vision.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 vertices */ + vertices?: (google.cloud.vision.v1.IVertex[]|null); + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.vision.v1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.vision.v1.IVertex[]; + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.vision.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.vision.v1.IBoundingPoly): google.cloud.vision.v1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.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.vision.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.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.vision.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.vision.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.vision.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.vision.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.vision.v1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Position. */ + interface IPosition { + + /** Position x */ + x?: (number|null); + + /** Position y */ + y?: (number|null); + + /** Position z */ + z?: (number|null); + } + + /** Represents a Position. */ + class Position implements IPosition { + + /** + * Constructs a new Position. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IPosition); + + /** Position x. */ + public x: number; + + /** Position y. */ + public y: number; + + /** Position z. */ + public z: number; + + /** + * Creates a new Position instance using the specified properties. + * @param [properties] Properties to set + * @returns Position instance + */ + public static create(properties?: google.cloud.vision.v1.IPosition): google.cloud.vision.v1.Position; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Position message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Position; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Position; + + /** + * Verifies a Position message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Position + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Position; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @param message Position + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Position, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Position to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProductSearchParams. */ + interface IProductSearchParams { + + /** ProductSearchParams boundingPoly */ + boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** ProductSearchParams productSet */ + productSet?: (string|null); + + /** ProductSearchParams productCategories */ + productCategories?: (string[]|null); + + /** ProductSearchParams filter */ + filter?: (string|null); + } + + /** Represents a ProductSearchParams. */ + class ProductSearchParams implements IProductSearchParams { + + /** + * Constructs a new ProductSearchParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IProductSearchParams); + + /** ProductSearchParams boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** ProductSearchParams productSet. */ + public productSet: string; + + /** ProductSearchParams productCategories. */ + public productCategories: string[]; + + /** ProductSearchParams filter. */ + public filter: string; + + /** + * Creates a new ProductSearchParams instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSearchParams instance + */ + public static create(properties?: google.cloud.vision.v1.IProductSearchParams): google.cloud.vision.v1.ProductSearchParams; + + /** + * Encodes the specified ProductSearchParams message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchParams.verify|verify} messages. + * @param message ProductSearchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IProductSearchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSearchParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchParams.verify|verify} messages. + * @param message ProductSearchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IProductSearchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ProductSearchParams; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ProductSearchParams; + + /** + * Verifies a ProductSearchParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSearchParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSearchParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ProductSearchParams; + + /** + * Creates a plain object from a ProductSearchParams message. Also converts values to other types if specified. + * @param message ProductSearchParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ProductSearchParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSearchParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProductSearchResults. */ + interface IProductSearchResults { + + /** ProductSearchResults indexTime */ + indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSearchResults results */ + results?: (google.cloud.vision.v1.ProductSearchResults.IResult[]|null); + + /** ProductSearchResults productGroupedResults */ + productGroupedResults?: (google.cloud.vision.v1.ProductSearchResults.IGroupedResult[]|null); + } + + /** Represents a ProductSearchResults. */ + class ProductSearchResults implements IProductSearchResults { + + /** + * Constructs a new ProductSearchResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IProductSearchResults); + + /** ProductSearchResults indexTime. */ + public indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSearchResults results. */ + public results: google.cloud.vision.v1.ProductSearchResults.IResult[]; + + /** ProductSearchResults productGroupedResults. */ + public productGroupedResults: google.cloud.vision.v1.ProductSearchResults.IGroupedResult[]; + + /** + * Creates a new ProductSearchResults instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSearchResults instance + */ + public static create(properties?: google.cloud.vision.v1.IProductSearchResults): google.cloud.vision.v1.ProductSearchResults; + + /** + * Encodes the specified ProductSearchResults message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.verify|verify} messages. + * @param message ProductSearchResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IProductSearchResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSearchResults message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.verify|verify} messages. + * @param message ProductSearchResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IProductSearchResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ProductSearchResults; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ProductSearchResults; + + /** + * Verifies a ProductSearchResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSearchResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSearchResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ProductSearchResults; + + /** + * Creates a plain object from a ProductSearchResults message. Also converts values to other types if specified. + * @param message ProductSearchResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ProductSearchResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSearchResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ProductSearchResults { + + /** Properties of a Result. */ + interface IResult { + + /** Result product */ + product?: (google.cloud.vision.v1.IProduct|null); + + /** Result score */ + score?: (number|null); + + /** Result image */ + image?: (string|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ProductSearchResults.IResult); + + /** Result product. */ + public product?: (google.cloud.vision.v1.IProduct|null); + + /** Result score. */ + public score: number; + + /** Result image. */ + public image: string; + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.cloud.vision.v1.ProductSearchResults.IResult): google.cloud.vision.v1.ProductSearchResults.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ProductSearchResults.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ProductSearchResults.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ProductSearchResults.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ProductSearchResults.Result; + + /** + * Verifies a Result message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ProductSearchResults.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ProductSearchResults.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ObjectAnnotation. */ + interface IObjectAnnotation { + + /** ObjectAnnotation mid */ + mid?: (string|null); + + /** ObjectAnnotation languageCode */ + languageCode?: (string|null); + + /** ObjectAnnotation name */ + name?: (string|null); + + /** ObjectAnnotation score */ + score?: (number|null); + } + + /** Represents an ObjectAnnotation. */ + class ObjectAnnotation implements IObjectAnnotation { + + /** + * Constructs a new ObjectAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation); + + /** ObjectAnnotation mid. */ + public mid: string; + + /** ObjectAnnotation languageCode. */ + public languageCode: string; + + /** ObjectAnnotation name. */ + public name: string; + + /** ObjectAnnotation score. */ + public score: number; + + /** + * Creates a new ObjectAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation): google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation; + + /** + * Encodes the specified ObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.verify|verify} messages. + * @param message ObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.verify|verify} messages. + * @param message ObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation; + + /** + * Decodes an ObjectAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation; + + /** + * Verifies an ObjectAnnotation message. + * @param message Plain 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 ObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation; + + /** + * Creates a plain object from an ObjectAnnotation message. Also converts values to other types if specified. + * @param message ObjectAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupedResult. */ + interface IGroupedResult { + + /** GroupedResult boundingPoly */ + boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** GroupedResult results */ + results?: (google.cloud.vision.v1.ProductSearchResults.IResult[]|null); + + /** GroupedResult objectAnnotations */ + objectAnnotations?: (google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation[]|null); + } + + /** Represents a GroupedResult. */ + class GroupedResult implements IGroupedResult { + + /** + * Constructs a new GroupedResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ProductSearchResults.IGroupedResult); + + /** GroupedResult boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** GroupedResult results. */ + public results: google.cloud.vision.v1.ProductSearchResults.IResult[]; + + /** GroupedResult objectAnnotations. */ + public objectAnnotations: google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation[]; + + /** + * Creates a new GroupedResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupedResult instance + */ + public static create(properties?: google.cloud.vision.v1.ProductSearchResults.IGroupedResult): google.cloud.vision.v1.ProductSearchResults.GroupedResult; + + /** + * Encodes the specified GroupedResult message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @param message GroupedResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ProductSearchResults.IGroupedResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupedResult message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @param message GroupedResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ProductSearchResults.IGroupedResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupedResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ProductSearchResults.GroupedResult; + + /** + * Decodes a GroupedResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ProductSearchResults.GroupedResult; + + /** + * Verifies a GroupedResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupedResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupedResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ProductSearchResults.GroupedResult; + + /** + * Creates a plain object from a GroupedResult message. Also converts values to other types if specified. + * @param message GroupedResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ProductSearchResults.GroupedResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupedResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Represents a ProductSearch */ + class ProductSearch extends $protobuf.rpc.Service { + + /** + * Constructs a new ProductSearch 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 ProductSearch 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): ProductSearch; + + /** + * Calls CreateProductSet. + * @param request CreateProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public createProductSet(request: google.cloud.vision.v1.ICreateProductSetRequest, callback: google.cloud.vision.v1.ProductSearch.CreateProductSetCallback): void; + + /** + * Calls CreateProductSet. + * @param request CreateProductSetRequest message or plain object + * @returns Promise + */ + public createProductSet(request: google.cloud.vision.v1.ICreateProductSetRequest): Promise; + + /** + * Calls ListProductSets. + * @param request ListProductSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductSetsResponse + */ + public listProductSets(request: google.cloud.vision.v1.IListProductSetsRequest, callback: google.cloud.vision.v1.ProductSearch.ListProductSetsCallback): void; + + /** + * Calls ListProductSets. + * @param request ListProductSetsRequest message or plain object + * @returns Promise + */ + public listProductSets(request: google.cloud.vision.v1.IListProductSetsRequest): Promise; + + /** + * Calls GetProductSet. + * @param request GetProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public getProductSet(request: google.cloud.vision.v1.IGetProductSetRequest, callback: google.cloud.vision.v1.ProductSearch.GetProductSetCallback): void; + + /** + * Calls GetProductSet. + * @param request GetProductSetRequest message or plain object + * @returns Promise + */ + public getProductSet(request: google.cloud.vision.v1.IGetProductSetRequest): Promise; + + /** + * Calls UpdateProductSet. + * @param request UpdateProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public updateProductSet(request: google.cloud.vision.v1.IUpdateProductSetRequest, callback: google.cloud.vision.v1.ProductSearch.UpdateProductSetCallback): void; + + /** + * Calls UpdateProductSet. + * @param request UpdateProductSetRequest message or plain object + * @returns Promise + */ + public updateProductSet(request: google.cloud.vision.v1.IUpdateProductSetRequest): Promise; + + /** + * Calls DeleteProductSet. + * @param request DeleteProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteProductSet(request: google.cloud.vision.v1.IDeleteProductSetRequest, callback: google.cloud.vision.v1.ProductSearch.DeleteProductSetCallback): void; + + /** + * Calls DeleteProductSet. + * @param request DeleteProductSetRequest message or plain object + * @returns Promise + */ + public deleteProductSet(request: google.cloud.vision.v1.IDeleteProductSetRequest): Promise; + + /** + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public createProduct(request: google.cloud.vision.v1.ICreateProductRequest, callback: google.cloud.vision.v1.ProductSearch.CreateProductCallback): void; + + /** + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @returns Promise + */ + public createProduct(request: google.cloud.vision.v1.ICreateProductRequest): Promise; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsResponse + */ + public listProducts(request: google.cloud.vision.v1.IListProductsRequest, callback: google.cloud.vision.v1.ProductSearch.ListProductsCallback): void; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @returns Promise + */ + public listProducts(request: google.cloud.vision.v1.IListProductsRequest): Promise; + + /** + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public getProduct(request: google.cloud.vision.v1.IGetProductRequest, callback: google.cloud.vision.v1.ProductSearch.GetProductCallback): void; + + /** + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @returns Promise + */ + public getProduct(request: google.cloud.vision.v1.IGetProductRequest): Promise; + + /** + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public updateProduct(request: google.cloud.vision.v1.IUpdateProductRequest, callback: google.cloud.vision.v1.ProductSearch.UpdateProductCallback): void; + + /** + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @returns Promise + */ + public updateProduct(request: google.cloud.vision.v1.IUpdateProductRequest): Promise; + + /** + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteProduct(request: google.cloud.vision.v1.IDeleteProductRequest, callback: google.cloud.vision.v1.ProductSearch.DeleteProductCallback): void; + + /** + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @returns Promise + */ + public deleteProduct(request: google.cloud.vision.v1.IDeleteProductRequest): Promise; + + /** + * Calls CreateReferenceImage. + * @param request CreateReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReferenceImage + */ + public createReferenceImage(request: google.cloud.vision.v1.ICreateReferenceImageRequest, callback: google.cloud.vision.v1.ProductSearch.CreateReferenceImageCallback): void; + + /** + * Calls CreateReferenceImage. + * @param request CreateReferenceImageRequest message or plain object + * @returns Promise + */ + public createReferenceImage(request: google.cloud.vision.v1.ICreateReferenceImageRequest): Promise; + + /** + * Calls DeleteReferenceImage. + * @param request DeleteReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteReferenceImage(request: google.cloud.vision.v1.IDeleteReferenceImageRequest, callback: google.cloud.vision.v1.ProductSearch.DeleteReferenceImageCallback): void; + + /** + * Calls DeleteReferenceImage. + * @param request DeleteReferenceImageRequest message or plain object + * @returns Promise + */ + public deleteReferenceImage(request: google.cloud.vision.v1.IDeleteReferenceImageRequest): Promise; + + /** + * Calls ListReferenceImages. + * @param request ListReferenceImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReferenceImagesResponse + */ + public listReferenceImages(request: google.cloud.vision.v1.IListReferenceImagesRequest, callback: google.cloud.vision.v1.ProductSearch.ListReferenceImagesCallback): void; + + /** + * Calls ListReferenceImages. + * @param request ListReferenceImagesRequest message or plain object + * @returns Promise + */ + public listReferenceImages(request: google.cloud.vision.v1.IListReferenceImagesRequest): Promise; + + /** + * Calls GetReferenceImage. + * @param request GetReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReferenceImage + */ + public getReferenceImage(request: google.cloud.vision.v1.IGetReferenceImageRequest, callback: google.cloud.vision.v1.ProductSearch.GetReferenceImageCallback): void; + + /** + * Calls GetReferenceImage. + * @param request GetReferenceImageRequest message or plain object + * @returns Promise + */ + public getReferenceImage(request: google.cloud.vision.v1.IGetReferenceImageRequest): Promise; + + /** + * Calls AddProductToProductSet. + * @param request AddProductToProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public addProductToProductSet(request: google.cloud.vision.v1.IAddProductToProductSetRequest, callback: google.cloud.vision.v1.ProductSearch.AddProductToProductSetCallback): void; + + /** + * Calls AddProductToProductSet. + * @param request AddProductToProductSetRequest message or plain object + * @returns Promise + */ + public addProductToProductSet(request: google.cloud.vision.v1.IAddProductToProductSetRequest): Promise; + + /** + * Calls RemoveProductFromProductSet. + * @param request RemoveProductFromProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public removeProductFromProductSet(request: google.cloud.vision.v1.IRemoveProductFromProductSetRequest, callback: google.cloud.vision.v1.ProductSearch.RemoveProductFromProductSetCallback): void; + + /** + * Calls RemoveProductFromProductSet. + * @param request RemoveProductFromProductSetRequest message or plain object + * @returns Promise + */ + public removeProductFromProductSet(request: google.cloud.vision.v1.IRemoveProductFromProductSetRequest): Promise; + + /** + * Calls ListProductsInProductSet. + * @param request ListProductsInProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsInProductSetResponse + */ + public listProductsInProductSet(request: google.cloud.vision.v1.IListProductsInProductSetRequest, callback: google.cloud.vision.v1.ProductSearch.ListProductsInProductSetCallback): void; + + /** + * Calls ListProductsInProductSet. + * @param request ListProductsInProductSetRequest message or plain object + * @returns Promise + */ + public listProductsInProductSet(request: google.cloud.vision.v1.IListProductsInProductSetRequest): Promise; + + /** + * Calls ImportProductSets. + * @param request ImportProductSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importProductSets(request: google.cloud.vision.v1.IImportProductSetsRequest, callback: google.cloud.vision.v1.ProductSearch.ImportProductSetsCallback): void; + + /** + * Calls ImportProductSets. + * @param request ImportProductSetsRequest message or plain object + * @returns Promise + */ + public importProductSets(request: google.cloud.vision.v1.IImportProductSetsRequest): Promise; + + /** + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public purgeProducts(request: google.cloud.vision.v1.IPurgeProductsRequest, callback: google.cloud.vision.v1.ProductSearch.PurgeProductsCallback): void; + + /** + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object + * @returns Promise + */ + public purgeProducts(request: google.cloud.vision.v1.IPurgeProductsRequest): Promise; + } + + namespace ProductSearch { + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#createProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type CreateProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listProductSets}. + * @param error Error, if any + * @param [response] ListProductSetsResponse + */ + type ListProductSetsCallback = (error: (Error|null), response?: google.cloud.vision.v1.ListProductSetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#getProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type GetProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#updateProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type UpdateProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#deleteProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#createProduct}. + * @param error Error, if any + * @param [response] Product + */ + type CreateProductCallback = (error: (Error|null), response?: google.cloud.vision.v1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listProducts}. + * @param error Error, if any + * @param [response] ListProductsResponse + */ + type ListProductsCallback = (error: (Error|null), response?: google.cloud.vision.v1.ListProductsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#getProduct}. + * @param error Error, if any + * @param [response] Product + */ + type GetProductCallback = (error: (Error|null), response?: google.cloud.vision.v1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#updateProduct}. + * @param error Error, if any + * @param [response] Product + */ + type UpdateProductCallback = (error: (Error|null), response?: google.cloud.vision.v1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#deleteProduct}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#createReferenceImage}. + * @param error Error, if any + * @param [response] ReferenceImage + */ + type CreateReferenceImageCallback = (error: (Error|null), response?: google.cloud.vision.v1.ReferenceImage) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#deleteReferenceImage}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteReferenceImageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listReferenceImages}. + * @param error Error, if any + * @param [response] ListReferenceImagesResponse + */ + type ListReferenceImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1.ListReferenceImagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#getReferenceImage}. + * @param error Error, if any + * @param [response] ReferenceImage + */ + type GetReferenceImageCallback = (error: (Error|null), response?: google.cloud.vision.v1.ReferenceImage) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#addProductToProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type AddProductToProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#removeProductFromProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type RemoveProductFromProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listProductsInProductSet}. + * @param error Error, if any + * @param [response] ListProductsInProductSetResponse + */ + type ListProductsInProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1.ListProductsInProductSetResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#importProductSets}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportProductSetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#purgeProducts}. + * @param error Error, if any + * @param [response] Operation + */ + type PurgeProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Product. */ + interface IProduct { + + /** Product name */ + name?: (string|null); + + /** Product displayName */ + displayName?: (string|null); + + /** Product description */ + description?: (string|null); + + /** Product productCategory */ + productCategory?: (string|null); + + /** Product productLabels */ + productLabels?: (google.cloud.vision.v1.Product.IKeyValue[]|null); + } + + /** Represents a Product. */ + class Product implements IProduct { + + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IProduct); + + /** Product name. */ + public name: string; + + /** Product displayName. */ + public displayName: string; + + /** Product description. */ + public description: string; + + /** Product productCategory. */ + public productCategory: string; + + /** Product productLabels. */ + public productLabels: google.cloud.vision.v1.Product.IKeyValue[]; + + /** + * Creates a new Product instance using the specified properties. + * @param [properties] Properties to set + * @returns Product instance + */ + public static create(properties?: google.cloud.vision.v1.IProduct): google.cloud.vision.v1.Product; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.vision.v1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Product message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Product; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Product; + + /** + * Verifies a Product message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Product + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Product; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Product to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Product { + + /** Properties of a KeyValue. */ + interface IKeyValue { + + /** KeyValue key */ + key?: (string|null); + + /** KeyValue value */ + value?: (string|null); + } + + /** Represents a KeyValue. */ + class KeyValue implements IKeyValue { + + /** + * Constructs a new KeyValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.Product.IKeyValue); + + /** KeyValue key. */ + public key: string; + + /** KeyValue value. */ + public value: string; + + /** + * Creates a new KeyValue instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyValue instance + */ + public static create(properties?: google.cloud.vision.v1.Product.IKeyValue): google.cloud.vision.v1.Product.KeyValue; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.cloud.vision.v1.Product.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.Product.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Product.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.Product.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Product.KeyValue; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Product.KeyValue; + + /** + * Verifies a KeyValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Product.KeyValue; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @param message KeyValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Product.KeyValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ProductSet. */ + interface IProductSet { + + /** ProductSet name */ + name?: (string|null); + + /** ProductSet displayName */ + displayName?: (string|null); + + /** ProductSet indexTime */ + indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSet indexError */ + indexError?: (google.rpc.IStatus|null); + } + + /** Represents a ProductSet. */ + class ProductSet implements IProductSet { + + /** + * Constructs a new ProductSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IProductSet); + + /** ProductSet name. */ + public name: string; + + /** ProductSet displayName. */ + public displayName: string; + + /** ProductSet indexTime. */ + public indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSet indexError. */ + public indexError?: (google.rpc.IStatus|null); + + /** + * Creates a new ProductSet instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSet instance + */ + public static create(properties?: google.cloud.vision.v1.IProductSet): google.cloud.vision.v1.ProductSet; + + /** + * Encodes the specified ProductSet message. Does not implicitly {@link google.cloud.vision.v1.ProductSet.verify|verify} messages. + * @param message ProductSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IProductSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSet message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSet.verify|verify} messages. + * @param message ProductSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IProductSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ProductSet; + + /** + * Decodes a ProductSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ProductSet; + + /** + * Verifies a ProductSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ProductSet; + + /** + * Creates a plain object from a ProductSet message. Also converts values to other types if specified. + * @param message ProductSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ProductSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReferenceImage. */ + interface IReferenceImage { + + /** ReferenceImage name */ + name?: (string|null); + + /** ReferenceImage uri */ + uri?: (string|null); + + /** ReferenceImage boundingPolys */ + boundingPolys?: (google.cloud.vision.v1.IBoundingPoly[]|null); + } + + /** Represents a ReferenceImage. */ + class ReferenceImage implements IReferenceImage { + + /** + * Constructs a new ReferenceImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IReferenceImage); + + /** ReferenceImage name. */ + public name: string; + + /** ReferenceImage uri. */ + public uri: string; + + /** ReferenceImage boundingPolys. */ + public boundingPolys: google.cloud.vision.v1.IBoundingPoly[]; + + /** + * Creates a new ReferenceImage instance using the specified properties. + * @param [properties] Properties to set + * @returns ReferenceImage instance + */ + public static create(properties?: google.cloud.vision.v1.IReferenceImage): google.cloud.vision.v1.ReferenceImage; + + /** + * Encodes the specified ReferenceImage message. Does not implicitly {@link google.cloud.vision.v1.ReferenceImage.verify|verify} messages. + * @param message ReferenceImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IReferenceImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReferenceImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ReferenceImage.verify|verify} messages. + * @param message ReferenceImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IReferenceImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ReferenceImage; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ReferenceImage; + + /** + * Verifies a ReferenceImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReferenceImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReferenceImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ReferenceImage; + + /** + * Creates a plain object from a ReferenceImage message. Also converts values to other types if specified. + * @param message ReferenceImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ReferenceImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReferenceImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateProductRequest. */ + interface ICreateProductRequest { + + /** CreateProductRequest parent */ + parent?: (string|null); + + /** CreateProductRequest product */ + product?: (google.cloud.vision.v1.IProduct|null); + + /** CreateProductRequest productId */ + productId?: (string|null); + } + + /** Represents a CreateProductRequest. */ + class CreateProductRequest implements ICreateProductRequest { + + /** + * Constructs a new CreateProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ICreateProductRequest); + + /** CreateProductRequest parent. */ + public parent: string; + + /** CreateProductRequest product. */ + public product?: (google.cloud.vision.v1.IProduct|null); + + /** CreateProductRequest productId. */ + public productId: string; + + /** + * Creates a new CreateProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1.ICreateProductRequest): google.cloud.vision.v1.CreateProductRequest; + + /** + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.vision.v1.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.CreateProductRequest; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.CreateProductRequest; + + /** + * Verifies a CreateProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.CreateProductRequest; + + /** + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @param message CreateProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsRequest. */ + interface IListProductsRequest { + + /** ListProductsRequest parent */ + parent?: (string|null); + + /** ListProductsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductsRequest. */ + class ListProductsRequest implements IListProductsRequest { + + /** + * Constructs a new ListProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListProductsRequest); + + /** ListProductsRequest parent. */ + public parent: string; + + /** ListProductsRequest pageSize. */ + public pageSize: number; + + /** ListProductsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IListProductsRequest): google.cloud.vision.v1.ListProductsRequest; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.vision.v1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListProductsRequest; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListProductsRequest; + + /** + * Verifies a ListProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListProductsRequest; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @param message ListProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsResponse. */ + interface IListProductsResponse { + + /** ListProductsResponse products */ + products?: (google.cloud.vision.v1.IProduct[]|null); + + /** ListProductsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsResponse. */ + class ListProductsResponse implements IListProductsResponse { + + /** + * Constructs a new ListProductsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListProductsResponse); + + /** ListProductsResponse products. */ + public products: google.cloud.vision.v1.IProduct[]; + + /** ListProductsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IListProductsResponse): google.cloud.vision.v1.ListProductsResponse; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.vision.v1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListProductsResponse; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListProductsResponse; + + /** + * Verifies a ListProductsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListProductsResponse; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @param message ListProductsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetProductRequest. */ + interface IGetProductRequest { + + /** GetProductRequest name */ + name?: (string|null); + } + + /** Represents a GetProductRequest. */ + class GetProductRequest implements IGetProductRequest { + + /** + * Constructs a new GetProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IGetProductRequest); + + /** GetProductRequest name. */ + public name: string; + + /** + * Creates a new GetProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IGetProductRequest): google.cloud.vision.v1.GetProductRequest; + + /** + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.vision.v1.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.GetProductRequest; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.GetProductRequest; + + /** + * Verifies a GetProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.GetProductRequest; + + /** + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @param message GetProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateProductRequest. */ + interface IUpdateProductRequest { + + /** UpdateProductRequest product */ + product?: (google.cloud.vision.v1.IProduct|null); + + /** UpdateProductRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProductRequest. */ + class UpdateProductRequest implements IUpdateProductRequest { + + /** + * Constructs a new UpdateProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IUpdateProductRequest); + + /** UpdateProductRequest product. */ + public product?: (google.cloud.vision.v1.IProduct|null); + + /** UpdateProductRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IUpdateProductRequest): google.cloud.vision.v1.UpdateProductRequest; + + /** + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.vision.v1.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.UpdateProductRequest; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.UpdateProductRequest; + + /** + * Verifies an UpdateProductRequest message. + * @param message Plain 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.UpdateProductRequest; + + /** + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @param message UpdateProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteProductRequest. */ + interface IDeleteProductRequest { + + /** DeleteProductRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProductRequest. */ + class DeleteProductRequest implements IDeleteProductRequest { + + /** + * Constructs a new DeleteProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IDeleteProductRequest); + + /** DeleteProductRequest name. */ + public name: string; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IDeleteProductRequest): google.cloud.vision.v1.DeleteProductRequest; + + /** + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.vision.v1.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.DeleteProductRequest; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.DeleteProductRequest; + + /** + * Verifies a DeleteProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.DeleteProductRequest; + + /** + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @param message DeleteProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateProductSetRequest. */ + interface ICreateProductSetRequest { + + /** CreateProductSetRequest parent */ + parent?: (string|null); + + /** CreateProductSetRequest productSet */ + productSet?: (google.cloud.vision.v1.IProductSet|null); + + /** CreateProductSetRequest productSetId */ + productSetId?: (string|null); + } + + /** Represents a CreateProductSetRequest. */ + class CreateProductSetRequest implements ICreateProductSetRequest { + + /** + * Constructs a new CreateProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ICreateProductSetRequest); + + /** CreateProductSetRequest parent. */ + public parent: string; + + /** CreateProductSetRequest productSet. */ + public productSet?: (google.cloud.vision.v1.IProductSet|null); + + /** CreateProductSetRequest productSetId. */ + public productSetId: string; + + /** + * Creates a new CreateProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1.ICreateProductSetRequest): google.cloud.vision.v1.CreateProductSetRequest; + + /** + * Encodes the specified CreateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.CreateProductSetRequest.verify|verify} messages. + * @param message CreateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ICreateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CreateProductSetRequest.verify|verify} messages. + * @param message CreateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ICreateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.CreateProductSetRequest; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.CreateProductSetRequest; + + /** + * Verifies a CreateProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.CreateProductSetRequest; + + /** + * Creates a plain object from a CreateProductSetRequest message. Also converts values to other types if specified. + * @param message CreateProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.CreateProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductSetsRequest. */ + interface IListProductSetsRequest { + + /** ListProductSetsRequest parent */ + parent?: (string|null); + + /** ListProductSetsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductSetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductSetsRequest. */ + class ListProductSetsRequest implements IListProductSetsRequest { + + /** + * Constructs a new ListProductSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListProductSetsRequest); + + /** ListProductSetsRequest parent. */ + public parent: string; + + /** ListProductSetsRequest pageSize. */ + public pageSize: number; + + /** ListProductSetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductSetsRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IListProductSetsRequest): google.cloud.vision.v1.ListProductSetsRequest; + + /** + * Encodes the specified ListProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsRequest.verify|verify} messages. + * @param message ListProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsRequest.verify|verify} messages. + * @param message ListProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListProductSetsRequest; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListProductSetsRequest; + + /** + * Verifies a ListProductSetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListProductSetsRequest; + + /** + * Creates a plain object from a ListProductSetsRequest message. Also converts values to other types if specified. + * @param message ListProductSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListProductSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductSetsResponse. */ + interface IListProductSetsResponse { + + /** ListProductSetsResponse productSets */ + productSets?: (google.cloud.vision.v1.IProductSet[]|null); + + /** ListProductSetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductSetsResponse. */ + class ListProductSetsResponse implements IListProductSetsResponse { + + /** + * Constructs a new ListProductSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListProductSetsResponse); + + /** ListProductSetsResponse productSets. */ + public productSets: google.cloud.vision.v1.IProductSet[]; + + /** ListProductSetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductSetsResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IListProductSetsResponse): google.cloud.vision.v1.ListProductSetsResponse; + + /** + * Encodes the specified ListProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsResponse.verify|verify} messages. + * @param message ListProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsResponse.verify|verify} messages. + * @param message ListProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListProductSetsResponse; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListProductSetsResponse; + + /** + * Verifies a ListProductSetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListProductSetsResponse; + + /** + * Creates a plain object from a ListProductSetsResponse message. Also converts values to other types if specified. + * @param message ListProductSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListProductSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetProductSetRequest. */ + interface IGetProductSetRequest { + + /** GetProductSetRequest name */ + name?: (string|null); + } + + /** Represents a GetProductSetRequest. */ + class GetProductSetRequest implements IGetProductSetRequest { + + /** + * Constructs a new GetProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IGetProductSetRequest); + + /** GetProductSetRequest name. */ + public name: string; + + /** + * Creates a new GetProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IGetProductSetRequest): google.cloud.vision.v1.GetProductSetRequest; + + /** + * Encodes the specified GetProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.GetProductSetRequest.verify|verify} messages. + * @param message GetProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IGetProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GetProductSetRequest.verify|verify} messages. + * @param message GetProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IGetProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.GetProductSetRequest; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.GetProductSetRequest; + + /** + * Verifies a GetProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.GetProductSetRequest; + + /** + * Creates a plain object from a GetProductSetRequest message. Also converts values to other types if specified. + * @param message GetProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.GetProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateProductSetRequest. */ + interface IUpdateProductSetRequest { + + /** UpdateProductSetRequest productSet */ + productSet?: (google.cloud.vision.v1.IProductSet|null); + + /** UpdateProductSetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProductSetRequest. */ + class UpdateProductSetRequest implements IUpdateProductSetRequest { + + /** + * Constructs a new UpdateProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IUpdateProductSetRequest); + + /** UpdateProductSetRequest productSet. */ + public productSet?: (google.cloud.vision.v1.IProductSet|null); + + /** UpdateProductSetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IUpdateProductSetRequest): google.cloud.vision.v1.UpdateProductSetRequest; + + /** + * Encodes the specified UpdateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.UpdateProductSetRequest.verify|verify} messages. + * @param message UpdateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IUpdateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.UpdateProductSetRequest.verify|verify} messages. + * @param message UpdateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IUpdateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.UpdateProductSetRequest; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.UpdateProductSetRequest; + + /** + * Verifies an UpdateProductSetRequest message. + * @param message Plain 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 UpdateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.UpdateProductSetRequest; + + /** + * Creates a plain object from an UpdateProductSetRequest message. Also converts values to other types if specified. + * @param message UpdateProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.UpdateProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteProductSetRequest. */ + interface IDeleteProductSetRequest { + + /** DeleteProductSetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProductSetRequest. */ + class DeleteProductSetRequest implements IDeleteProductSetRequest { + + /** + * Constructs a new DeleteProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IDeleteProductSetRequest); + + /** DeleteProductSetRequest name. */ + public name: string; + + /** + * Creates a new DeleteProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IDeleteProductSetRequest): google.cloud.vision.v1.DeleteProductSetRequest; + + /** + * Encodes the specified DeleteProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.DeleteProductSetRequest.verify|verify} messages. + * @param message DeleteProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IDeleteProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DeleteProductSetRequest.verify|verify} messages. + * @param message DeleteProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IDeleteProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.DeleteProductSetRequest; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.DeleteProductSetRequest; + + /** + * Verifies a DeleteProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.DeleteProductSetRequest; + + /** + * Creates a plain object from a DeleteProductSetRequest message. Also converts values to other types if specified. + * @param message DeleteProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.DeleteProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateReferenceImageRequest. */ + interface ICreateReferenceImageRequest { + + /** CreateReferenceImageRequest parent */ + parent?: (string|null); + + /** CreateReferenceImageRequest referenceImage */ + referenceImage?: (google.cloud.vision.v1.IReferenceImage|null); + + /** CreateReferenceImageRequest referenceImageId */ + referenceImageId?: (string|null); + } + + /** Represents a CreateReferenceImageRequest. */ + class CreateReferenceImageRequest implements ICreateReferenceImageRequest { + + /** + * Constructs a new CreateReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ICreateReferenceImageRequest); + + /** CreateReferenceImageRequest parent. */ + public parent: string; + + /** CreateReferenceImageRequest referenceImage. */ + public referenceImage?: (google.cloud.vision.v1.IReferenceImage|null); + + /** CreateReferenceImageRequest referenceImageId. */ + public referenceImageId: string; + + /** + * Creates a new CreateReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1.ICreateReferenceImageRequest): google.cloud.vision.v1.CreateReferenceImageRequest; + + /** + * Encodes the specified CreateReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1.CreateReferenceImageRequest.verify|verify} messages. + * @param message CreateReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ICreateReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CreateReferenceImageRequest.verify|verify} messages. + * @param message CreateReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ICreateReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.CreateReferenceImageRequest; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.CreateReferenceImageRequest; + + /** + * Verifies a CreateReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.CreateReferenceImageRequest; + + /** + * Creates a plain object from a CreateReferenceImageRequest message. Also converts values to other types if specified. + * @param message CreateReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.CreateReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReferenceImagesRequest. */ + interface IListReferenceImagesRequest { + + /** ListReferenceImagesRequest parent */ + parent?: (string|null); + + /** ListReferenceImagesRequest pageSize */ + pageSize?: (number|null); + + /** ListReferenceImagesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListReferenceImagesRequest. */ + class ListReferenceImagesRequest implements IListReferenceImagesRequest { + + /** + * Constructs a new ListReferenceImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListReferenceImagesRequest); + + /** ListReferenceImagesRequest parent. */ + public parent: string; + + /** ListReferenceImagesRequest pageSize. */ + public pageSize: number; + + /** ListReferenceImagesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListReferenceImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReferenceImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IListReferenceImagesRequest): google.cloud.vision.v1.ListReferenceImagesRequest; + + /** + * Encodes the specified ListReferenceImagesRequest message. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesRequest.verify|verify} messages. + * @param message ListReferenceImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListReferenceImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReferenceImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesRequest.verify|verify} messages. + * @param message ListReferenceImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListReferenceImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListReferenceImagesRequest; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListReferenceImagesRequest; + + /** + * Verifies a ListReferenceImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReferenceImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReferenceImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListReferenceImagesRequest; + + /** + * Creates a plain object from a ListReferenceImagesRequest message. Also converts values to other types if specified. + * @param message ListReferenceImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListReferenceImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReferenceImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReferenceImagesResponse. */ + interface IListReferenceImagesResponse { + + /** ListReferenceImagesResponse referenceImages */ + referenceImages?: (google.cloud.vision.v1.IReferenceImage[]|null); + + /** ListReferenceImagesResponse pageSize */ + pageSize?: (number|null); + + /** ListReferenceImagesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReferenceImagesResponse. */ + class ListReferenceImagesResponse implements IListReferenceImagesResponse { + + /** + * Constructs a new ListReferenceImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListReferenceImagesResponse); + + /** ListReferenceImagesResponse referenceImages. */ + public referenceImages: google.cloud.vision.v1.IReferenceImage[]; + + /** ListReferenceImagesResponse pageSize. */ + public pageSize: number; + + /** ListReferenceImagesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReferenceImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReferenceImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IListReferenceImagesResponse): google.cloud.vision.v1.ListReferenceImagesResponse; + + /** + * Encodes the specified ListReferenceImagesResponse message. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesResponse.verify|verify} messages. + * @param message ListReferenceImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListReferenceImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReferenceImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesResponse.verify|verify} messages. + * @param message ListReferenceImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListReferenceImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListReferenceImagesResponse; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListReferenceImagesResponse; + + /** + * Verifies a ListReferenceImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReferenceImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReferenceImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListReferenceImagesResponse; + + /** + * Creates a plain object from a ListReferenceImagesResponse message. Also converts values to other types if specified. + * @param message ListReferenceImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListReferenceImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReferenceImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetReferenceImageRequest. */ + interface IGetReferenceImageRequest { + + /** GetReferenceImageRequest name */ + name?: (string|null); + } + + /** Represents a GetReferenceImageRequest. */ + class GetReferenceImageRequest implements IGetReferenceImageRequest { + + /** + * Constructs a new GetReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IGetReferenceImageRequest); + + /** GetReferenceImageRequest name. */ + public name: string; + + /** + * Creates a new GetReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IGetReferenceImageRequest): google.cloud.vision.v1.GetReferenceImageRequest; + + /** + * Encodes the specified GetReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1.GetReferenceImageRequest.verify|verify} messages. + * @param message GetReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IGetReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GetReferenceImageRequest.verify|verify} messages. + * @param message GetReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IGetReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.GetReferenceImageRequest; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.GetReferenceImageRequest; + + /** + * Verifies a GetReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.GetReferenceImageRequest; + + /** + * Creates a plain object from a GetReferenceImageRequest message. Also converts values to other types if specified. + * @param message GetReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.GetReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteReferenceImageRequest. */ + interface IDeleteReferenceImageRequest { + + /** DeleteReferenceImageRequest name */ + name?: (string|null); + } + + /** Represents a DeleteReferenceImageRequest. */ + class DeleteReferenceImageRequest implements IDeleteReferenceImageRequest { + + /** + * Constructs a new DeleteReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IDeleteReferenceImageRequest); + + /** DeleteReferenceImageRequest name. */ + public name: string; + + /** + * Creates a new DeleteReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IDeleteReferenceImageRequest): google.cloud.vision.v1.DeleteReferenceImageRequest; + + /** + * Encodes the specified DeleteReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1.DeleteReferenceImageRequest.verify|verify} messages. + * @param message DeleteReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IDeleteReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DeleteReferenceImageRequest.verify|verify} messages. + * @param message DeleteReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IDeleteReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.DeleteReferenceImageRequest; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.DeleteReferenceImageRequest; + + /** + * Verifies a DeleteReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.DeleteReferenceImageRequest; + + /** + * Creates a plain object from a DeleteReferenceImageRequest message. Also converts values to other types if specified. + * @param message DeleteReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.DeleteReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddProductToProductSetRequest. */ + interface IAddProductToProductSetRequest { + + /** AddProductToProductSetRequest name */ + name?: (string|null); + + /** AddProductToProductSetRequest product */ + product?: (string|null); + } + + /** Represents an AddProductToProductSetRequest. */ + class AddProductToProductSetRequest implements IAddProductToProductSetRequest { + + /** + * Constructs a new AddProductToProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IAddProductToProductSetRequest); + + /** AddProductToProductSetRequest name. */ + public name: string; + + /** AddProductToProductSetRequest product. */ + public product: string; + + /** + * Creates a new AddProductToProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddProductToProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IAddProductToProductSetRequest): google.cloud.vision.v1.AddProductToProductSetRequest; + + /** + * Encodes the specified AddProductToProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.AddProductToProductSetRequest.verify|verify} messages. + * @param message AddProductToProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IAddProductToProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddProductToProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AddProductToProductSetRequest.verify|verify} messages. + * @param message AddProductToProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IAddProductToProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.AddProductToProductSetRequest; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.AddProductToProductSetRequest; + + /** + * Verifies an AddProductToProductSetRequest message. + * @param message Plain 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 AddProductToProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddProductToProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.AddProductToProductSetRequest; + + /** + * Creates a plain object from an AddProductToProductSetRequest message. Also converts values to other types if specified. + * @param message AddProductToProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.AddProductToProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddProductToProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveProductFromProductSetRequest. */ + interface IRemoveProductFromProductSetRequest { + + /** RemoveProductFromProductSetRequest name */ + name?: (string|null); + + /** RemoveProductFromProductSetRequest product */ + product?: (string|null); + } + + /** Represents a RemoveProductFromProductSetRequest. */ + class RemoveProductFromProductSetRequest implements IRemoveProductFromProductSetRequest { + + /** + * Constructs a new RemoveProductFromProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IRemoveProductFromProductSetRequest); + + /** RemoveProductFromProductSetRequest name. */ + public name: string; + + /** RemoveProductFromProductSetRequest product. */ + public product: string; + + /** + * Creates a new RemoveProductFromProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveProductFromProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IRemoveProductFromProductSetRequest): google.cloud.vision.v1.RemoveProductFromProductSetRequest; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @param message RemoveProductFromProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IRemoveProductFromProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @param message RemoveProductFromProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IRemoveProductFromProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.RemoveProductFromProductSetRequest; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.RemoveProductFromProductSetRequest; + + /** + * Verifies a RemoveProductFromProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveProductFromProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveProductFromProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.RemoveProductFromProductSetRequest; + + /** + * Creates a plain object from a RemoveProductFromProductSetRequest message. Also converts values to other types if specified. + * @param message RemoveProductFromProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.RemoveProductFromProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveProductFromProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsInProductSetRequest. */ + interface IListProductsInProductSetRequest { + + /** ListProductsInProductSetRequest name */ + name?: (string|null); + + /** ListProductsInProductSetRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsInProductSetRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductsInProductSetRequest. */ + class ListProductsInProductSetRequest implements IListProductsInProductSetRequest { + + /** + * Constructs a new ListProductsInProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListProductsInProductSetRequest); + + /** ListProductsInProductSetRequest name. */ + public name: string; + + /** ListProductsInProductSetRequest pageSize. */ + public pageSize: number; + + /** ListProductsInProductSetRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductsInProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsInProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IListProductsInProductSetRequest): google.cloud.vision.v1.ListProductsInProductSetRequest; + + /** + * Encodes the specified ListProductsInProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetRequest.verify|verify} messages. + * @param message ListProductsInProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListProductsInProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsInProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetRequest.verify|verify} messages. + * @param message ListProductsInProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListProductsInProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListProductsInProductSetRequest; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListProductsInProductSetRequest; + + /** + * Verifies a ListProductsInProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsInProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsInProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListProductsInProductSetRequest; + + /** + * Creates a plain object from a ListProductsInProductSetRequest message. Also converts values to other types if specified. + * @param message ListProductsInProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListProductsInProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsInProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsInProductSetResponse. */ + interface IListProductsInProductSetResponse { + + /** ListProductsInProductSetResponse products */ + products?: (google.cloud.vision.v1.IProduct[]|null); + + /** ListProductsInProductSetResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsInProductSetResponse. */ + class ListProductsInProductSetResponse implements IListProductsInProductSetResponse { + + /** + * Constructs a new ListProductsInProductSetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IListProductsInProductSetResponse); + + /** ListProductsInProductSetResponse products. */ + public products: google.cloud.vision.v1.IProduct[]; + + /** ListProductsInProductSetResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductsInProductSetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsInProductSetResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IListProductsInProductSetResponse): google.cloud.vision.v1.ListProductsInProductSetResponse; + + /** + * Encodes the specified ListProductsInProductSetResponse message. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetResponse.verify|verify} messages. + * @param message ListProductsInProductSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IListProductsInProductSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsInProductSetResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetResponse.verify|verify} messages. + * @param message ListProductsInProductSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IListProductsInProductSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ListProductsInProductSetResponse; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ListProductsInProductSetResponse; + + /** + * Verifies a ListProductsInProductSetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsInProductSetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsInProductSetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ListProductsInProductSetResponse; + + /** + * Creates a plain object from a ListProductsInProductSetResponse message. Also converts values to other types if specified. + * @param message ListProductsInProductSetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ListProductsInProductSetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsInProductSetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsGcsSource. */ + interface IImportProductSetsGcsSource { + + /** ImportProductSetsGcsSource csvFileUri */ + csvFileUri?: (string|null); + } + + /** Represents an ImportProductSetsGcsSource. */ + class ImportProductSetsGcsSource implements IImportProductSetsGcsSource { + + /** + * Constructs a new ImportProductSetsGcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImportProductSetsGcsSource); + + /** ImportProductSetsGcsSource csvFileUri. */ + public csvFileUri: string; + + /** + * Creates a new ImportProductSetsGcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsGcsSource instance + */ + public static create(properties?: google.cloud.vision.v1.IImportProductSetsGcsSource): google.cloud.vision.v1.ImportProductSetsGcsSource; + + /** + * Encodes the specified ImportProductSetsGcsSource message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsGcsSource.verify|verify} messages. + * @param message ImportProductSetsGcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImportProductSetsGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsGcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsGcsSource.verify|verify} messages. + * @param message ImportProductSetsGcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImportProductSetsGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImportProductSetsGcsSource; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImportProductSetsGcsSource; + + /** + * Verifies an ImportProductSetsGcsSource message. + * @param message Plain 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 ImportProductSetsGcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsGcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImportProductSetsGcsSource; + + /** + * Creates a plain object from an ImportProductSetsGcsSource message. Also converts values to other types if specified. + * @param message ImportProductSetsGcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImportProductSetsGcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsGcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsInputConfig. */ + interface IImportProductSetsInputConfig { + + /** ImportProductSetsInputConfig gcsSource */ + gcsSource?: (google.cloud.vision.v1.IImportProductSetsGcsSource|null); + } + + /** Represents an ImportProductSetsInputConfig. */ + class ImportProductSetsInputConfig implements IImportProductSetsInputConfig { + + /** + * Constructs a new ImportProductSetsInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImportProductSetsInputConfig); + + /** ImportProductSetsInputConfig gcsSource. */ + public gcsSource?: (google.cloud.vision.v1.IImportProductSetsGcsSource|null); + + /** ImportProductSetsInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new ImportProductSetsInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsInputConfig instance + */ + public static create(properties?: google.cloud.vision.v1.IImportProductSetsInputConfig): google.cloud.vision.v1.ImportProductSetsInputConfig; + + /** + * Encodes the specified ImportProductSetsInputConfig message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsInputConfig.verify|verify} messages. + * @param message ImportProductSetsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImportProductSetsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsInputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsInputConfig.verify|verify} messages. + * @param message ImportProductSetsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImportProductSetsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImportProductSetsInputConfig; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImportProductSetsInputConfig; + + /** + * Verifies an ImportProductSetsInputConfig message. + * @param message Plain 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 ImportProductSetsInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImportProductSetsInputConfig; + + /** + * Creates a plain object from an ImportProductSetsInputConfig message. Also converts values to other types if specified. + * @param message ImportProductSetsInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImportProductSetsInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsRequest. */ + interface IImportProductSetsRequest { + + /** ImportProductSetsRequest parent */ + parent?: (string|null); + + /** ImportProductSetsRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1.IImportProductSetsInputConfig|null); + } + + /** Represents an ImportProductSetsRequest. */ + class ImportProductSetsRequest implements IImportProductSetsRequest { + + /** + * Constructs a new ImportProductSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImportProductSetsRequest); + + /** ImportProductSetsRequest parent. */ + public parent: string; + + /** ImportProductSetsRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1.IImportProductSetsInputConfig|null); + + /** + * Creates a new ImportProductSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IImportProductSetsRequest): google.cloud.vision.v1.ImportProductSetsRequest; + + /** + * Encodes the specified ImportProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsRequest.verify|verify} messages. + * @param message ImportProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImportProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsRequest.verify|verify} messages. + * @param message ImportProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImportProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImportProductSetsRequest; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImportProductSetsRequest; + + /** + * Verifies an ImportProductSetsRequest message. + * @param message Plain 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 ImportProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImportProductSetsRequest; + + /** + * Creates a plain object from an ImportProductSetsRequest message. Also converts values to other types if specified. + * @param message ImportProductSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImportProductSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsResponse. */ + interface IImportProductSetsResponse { + + /** ImportProductSetsResponse referenceImages */ + referenceImages?: (google.cloud.vision.v1.IReferenceImage[]|null); + + /** ImportProductSetsResponse statuses */ + statuses?: (google.rpc.IStatus[]|null); + } + + /** Represents an ImportProductSetsResponse. */ + class ImportProductSetsResponse implements IImportProductSetsResponse { + + /** + * Constructs a new ImportProductSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IImportProductSetsResponse); + + /** ImportProductSetsResponse referenceImages. */ + public referenceImages: google.cloud.vision.v1.IReferenceImage[]; + + /** ImportProductSetsResponse statuses. */ + public statuses: google.rpc.IStatus[]; + + /** + * Creates a new ImportProductSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsResponse instance + */ + public static create(properties?: google.cloud.vision.v1.IImportProductSetsResponse): google.cloud.vision.v1.ImportProductSetsResponse; + + /** + * Encodes the specified ImportProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsResponse.verify|verify} messages. + * @param message ImportProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IImportProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsResponse.verify|verify} messages. + * @param message ImportProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IImportProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ImportProductSetsResponse; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ImportProductSetsResponse; + + /** + * Verifies an ImportProductSetsResponse message. + * @param message Plain 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 ImportProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ImportProductSetsResponse; + + /** + * Creates a plain object from an ImportProductSetsResponse message. Also converts values to other types if specified. + * @param message ImportProductSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ImportProductSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchOperationMetadata. */ + interface IBatchOperationMetadata { + + /** BatchOperationMetadata state */ + state?: (google.cloud.vision.v1.BatchOperationMetadata.State|null); + + /** BatchOperationMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchOperationMetadata. */ + class BatchOperationMetadata implements IBatchOperationMetadata { + + /** + * Constructs a new BatchOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IBatchOperationMetadata); + + /** BatchOperationMetadata state. */ + public state: google.cloud.vision.v1.BatchOperationMetadata.State; + + /** BatchOperationMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOperationMetadata instance + */ + public static create(properties?: google.cloud.vision.v1.IBatchOperationMetadata): google.cloud.vision.v1.BatchOperationMetadata; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.vision.v1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.BatchOperationMetadata; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.BatchOperationMetadata; + + /** + * Verifies a BatchOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.BatchOperationMetadata; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @param message BatchOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.BatchOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROCESSING = 1, + SUCCESSFUL = 2, + FAILED = 3, + CANCELLED = 4 + } + } + + /** Properties of a ProductSetPurgeConfig. */ + interface IProductSetPurgeConfig { + + /** ProductSetPurgeConfig productSetId */ + productSetId?: (string|null); + } + + /** Represents a ProductSetPurgeConfig. */ + class ProductSetPurgeConfig implements IProductSetPurgeConfig { + + /** + * Constructs a new ProductSetPurgeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IProductSetPurgeConfig); + + /** ProductSetPurgeConfig productSetId. */ + public productSetId: string; + + /** + * Creates a new ProductSetPurgeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSetPurgeConfig instance + */ + public static create(properties?: google.cloud.vision.v1.IProductSetPurgeConfig): google.cloud.vision.v1.ProductSetPurgeConfig; + + /** + * Encodes the specified ProductSetPurgeConfig message. Does not implicitly {@link google.cloud.vision.v1.ProductSetPurgeConfig.verify|verify} messages. + * @param message ProductSetPurgeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IProductSetPurgeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSetPurgeConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSetPurgeConfig.verify|verify} messages. + * @param message ProductSetPurgeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IProductSetPurgeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSetPurgeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSetPurgeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.ProductSetPurgeConfig; + + /** + * Decodes a ProductSetPurgeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSetPurgeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.ProductSetPurgeConfig; + + /** + * Verifies a ProductSetPurgeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSetPurgeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSetPurgeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.ProductSetPurgeConfig; + + /** + * Creates a plain object from a ProductSetPurgeConfig message. Also converts values to other types if specified. + * @param message ProductSetPurgeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.ProductSetPurgeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSetPurgeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PurgeProductsRequest. */ + interface IPurgeProductsRequest { + + /** PurgeProductsRequest productSetPurgeConfig */ + productSetPurgeConfig?: (google.cloud.vision.v1.IProductSetPurgeConfig|null); + + /** PurgeProductsRequest deleteOrphanProducts */ + deleteOrphanProducts?: (boolean|null); + + /** PurgeProductsRequest parent */ + parent?: (string|null); + + /** PurgeProductsRequest force */ + force?: (boolean|null); + } + + /** Represents a PurgeProductsRequest. */ + class PurgeProductsRequest implements IPurgeProductsRequest { + + /** + * Constructs a new PurgeProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IPurgeProductsRequest); + + /** PurgeProductsRequest productSetPurgeConfig. */ + public productSetPurgeConfig?: (google.cloud.vision.v1.IProductSetPurgeConfig|null); + + /** PurgeProductsRequest deleteOrphanProducts. */ + public deleteOrphanProducts: boolean; + + /** PurgeProductsRequest parent. */ + public parent: string; + + /** PurgeProductsRequest force. */ + public force: boolean; + + /** PurgeProductsRequest target. */ + public target?: ("productSetPurgeConfig"|"deleteOrphanProducts"); + + /** + * Creates a new PurgeProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeProductsRequest instance + */ + public static create(properties?: google.cloud.vision.v1.IPurgeProductsRequest): google.cloud.vision.v1.PurgeProductsRequest; + + /** + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.vision.v1.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.PurgeProductsRequest; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.PurgeProductsRequest; + + /** + * Verifies a PurgeProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.PurgeProductsRequest; + + /** + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * @param message PurgeProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.PurgeProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation pages */ + pages?: (google.cloud.vision.v1.IPage[]|null); + + /** TextAnnotation text */ + text?: (string|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ITextAnnotation); + + /** TextAnnotation pages. */ + public pages: google.cloud.vision.v1.IPage[]; + + /** TextAnnotation text. */ + public text: string; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1.ITextAnnotation): google.cloud.vision.v1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TextAnnotation { + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.TextAnnotation.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.vision.v1.TextAnnotation.IDetectedLanguage): google.cloud.vision.v1.TextAnnotation.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.TextAnnotation.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.TextAnnotation.DetectedLanguage; + + /** + * Verifies a DetectedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.TextAnnotation.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.TextAnnotation.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectedBreak. */ + interface IDetectedBreak { + + /** DetectedBreak type */ + type?: (google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType|null); + + /** DetectedBreak isPrefix */ + isPrefix?: (boolean|null); + } + + /** Represents a DetectedBreak. */ + class DetectedBreak implements IDetectedBreak { + + /** + * Constructs a new DetectedBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.TextAnnotation.IDetectedBreak); + + /** DetectedBreak type. */ + public type: google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType; + + /** DetectedBreak isPrefix. */ + public isPrefix: boolean; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedBreak instance + */ + public static create(properties?: google.cloud.vision.v1.TextAnnotation.IDetectedBreak): google.cloud.vision.v1.TextAnnotation.DetectedBreak; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.TextAnnotation.DetectedBreak; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.TextAnnotation.DetectedBreak; + + /** + * Verifies a DetectedBreak message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedBreak + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.TextAnnotation.DetectedBreak; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @param message DetectedBreak + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.TextAnnotation.DetectedBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DetectedBreak { + + /** BreakType enum. */ + enum BreakType { + UNKNOWN = 0, + SPACE = 1, + SURE_SPACE = 2, + EOL_SURE_SPACE = 3, + HYPHEN = 4, + LINE_BREAK = 5 + } + } + + /** Properties of a TextProperty. */ + interface ITextProperty { + + /** TextProperty detectedLanguages */ + detectedLanguages?: (google.cloud.vision.v1.TextAnnotation.IDetectedLanguage[]|null); + + /** TextProperty detectedBreak */ + detectedBreak?: (google.cloud.vision.v1.TextAnnotation.IDetectedBreak|null); + } + + /** Represents a TextProperty. */ + class TextProperty implements ITextProperty { + + /** + * Constructs a new TextProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.TextAnnotation.ITextProperty); + + /** TextProperty detectedLanguages. */ + public detectedLanguages: google.cloud.vision.v1.TextAnnotation.IDetectedLanguage[]; + + /** TextProperty detectedBreak. */ + public detectedBreak?: (google.cloud.vision.v1.TextAnnotation.IDetectedBreak|null); + + /** + * Creates a new TextProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns TextProperty instance + */ + public static create(properties?: google.cloud.vision.v1.TextAnnotation.ITextProperty): google.cloud.vision.v1.TextAnnotation.TextProperty; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.TextAnnotation.TextProperty; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.TextAnnotation.TextProperty; + + /** + * Verifies a TextProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.TextAnnotation.TextProperty; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @param message TextProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.TextAnnotation.TextProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Page. */ + interface IPage { + + /** Page property */ + property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Page width */ + width?: (number|null); + + /** Page height */ + height?: (number|null); + + /** Page blocks */ + blocks?: (google.cloud.vision.v1.IBlock[]|null); + + /** Page confidence */ + confidence?: (number|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IPage); + + /** Page property. */ + public property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Page width. */ + public width: number; + + /** Page height. */ + public height: number; + + /** Page blocks. */ + public blocks: google.cloud.vision.v1.IBlock[]; + + /** Page confidence. */ + public confidence: number; + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.vision.v1.IPage): google.cloud.vision.v1.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Page; + + /** + * Verifies a Page message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Block. */ + interface IBlock { + + /** Block property */ + property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox */ + boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Block paragraphs */ + paragraphs?: (google.cloud.vision.v1.IParagraph[]|null); + + /** Block blockType */ + blockType?: (google.cloud.vision.v1.Block.BlockType|null); + + /** Block confidence */ + confidence?: (number|null); + } + + /** Represents a Block. */ + class Block implements IBlock { + + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IBlock); + + /** Block property. */ + public property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox. */ + public boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Block paragraphs. */ + public paragraphs: google.cloud.vision.v1.IParagraph[]; + + /** Block blockType. */ + public blockType: google.cloud.vision.v1.Block.BlockType; + + /** Block confidence. */ + public confidence: number; + + /** + * Creates a new Block instance using the specified properties. + * @param [properties] Properties to set + * @returns Block instance + */ + public static create(properties?: google.cloud.vision.v1.IBlock): google.cloud.vision.v1.Block; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Block message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Block; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Block; + + /** + * Verifies a Block message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Block + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Block; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @param message Block + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Block to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Block { + + /** BlockType enum. */ + enum BlockType { + UNKNOWN = 0, + TEXT = 1, + TABLE = 2, + PICTURE = 3, + RULER = 4, + BARCODE = 5 + } + } + + /** Properties of a Paragraph. */ + interface IParagraph { + + /** Paragraph property */ + property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox */ + boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Paragraph words */ + words?: (google.cloud.vision.v1.IWord[]|null); + + /** Paragraph confidence */ + confidence?: (number|null); + } + + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { + + /** + * Constructs a new Paragraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IParagraph); + + /** Paragraph property. */ + public property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox. */ + public boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Paragraph words. */ + public words: google.cloud.vision.v1.IWord[]; + + /** Paragraph confidence. */ + public confidence: number; + + /** + * Creates a new Paragraph instance using the specified properties. + * @param [properties] Properties to set + * @returns Paragraph instance + */ + public static create(properties?: google.cloud.vision.v1.IParagraph): google.cloud.vision.v1.Paragraph; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Paragraph; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Paragraph; + + /** + * Verifies a Paragraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Paragraph + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Paragraph; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @param message Paragraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Paragraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Word. */ + interface IWord { + + /** Word property */ + property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox */ + boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Word symbols */ + symbols?: (google.cloud.vision.v1.ISymbol[]|null); + + /** Word confidence */ + confidence?: (number|null); + } + + /** Represents a Word. */ + class Word implements IWord { + + /** + * Constructs a new Word. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IWord); + + /** Word property. */ + public property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox. */ + public boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Word symbols. */ + public symbols: google.cloud.vision.v1.ISymbol[]; + + /** Word confidence. */ + public confidence: number; + + /** + * Creates a new Word instance using the specified properties. + * @param [properties] Properties to set + * @returns Word instance + */ + public static create(properties?: google.cloud.vision.v1.IWord): google.cloud.vision.v1.Word; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Word message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Word; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Word; + + /** + * Verifies a Word message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Word + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Word; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @param message Word + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Word, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Word to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Symbol. */ + interface ISymbol { + + /** Symbol property */ + property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox */ + boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Symbol text */ + text?: (string|null); + + /** Symbol confidence */ + confidence?: (number|null); + } + + /** Represents a Symbol. */ + class Symbol implements ISymbol { + + /** + * Constructs a new Symbol. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.ISymbol); + + /** Symbol property. */ + public property?: (google.cloud.vision.v1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox. */ + public boundingBox?: (google.cloud.vision.v1.IBoundingPoly|null); + + /** Symbol text. */ + public text: string; + + /** Symbol confidence. */ + public confidence: number; + + /** + * Creates a new Symbol instance using the specified properties. + * @param [properties] Properties to set + * @returns Symbol instance + */ + public static create(properties?: google.cloud.vision.v1.ISymbol): google.cloud.vision.v1.Symbol; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.Symbol; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.Symbol; + + /** + * Verifies a Symbol message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Symbol + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.Symbol; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @param message Symbol + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Symbol to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetection. */ + interface IWebDetection { + + /** WebDetection webEntities */ + webEntities?: (google.cloud.vision.v1.WebDetection.IWebEntity[]|null); + + /** WebDetection fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1.WebDetection.IWebImage[]|null); + + /** WebDetection partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1.WebDetection.IWebImage[]|null); + + /** WebDetection pagesWithMatchingImages */ + pagesWithMatchingImages?: (google.cloud.vision.v1.WebDetection.IWebPage[]|null); + + /** WebDetection visuallySimilarImages */ + visuallySimilarImages?: (google.cloud.vision.v1.WebDetection.IWebImage[]|null); + + /** WebDetection bestGuessLabels */ + bestGuessLabels?: (google.cloud.vision.v1.WebDetection.IWebLabel[]|null); + } + + /** Represents a WebDetection. */ + class WebDetection implements IWebDetection { + + /** + * Constructs a new WebDetection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.IWebDetection); + + /** WebDetection webEntities. */ + public webEntities: google.cloud.vision.v1.WebDetection.IWebEntity[]; + + /** WebDetection fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1.WebDetection.IWebImage[]; + + /** WebDetection partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1.WebDetection.IWebImage[]; + + /** WebDetection pagesWithMatchingImages. */ + public pagesWithMatchingImages: google.cloud.vision.v1.WebDetection.IWebPage[]; + + /** WebDetection visuallySimilarImages. */ + public visuallySimilarImages: google.cloud.vision.v1.WebDetection.IWebImage[]; + + /** WebDetection bestGuessLabels. */ + public bestGuessLabels: google.cloud.vision.v1.WebDetection.IWebLabel[]; + + /** + * Creates a new WebDetection instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetection instance + */ + public static create(properties?: google.cloud.vision.v1.IWebDetection): google.cloud.vision.v1.WebDetection; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.WebDetection; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.WebDetection; + + /** + * Verifies a WebDetection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.WebDetection; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @param message WebDetection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.WebDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WebDetection { + + /** Properties of a WebEntity. */ + interface IWebEntity { + + /** WebEntity entityId */ + entityId?: (string|null); + + /** WebEntity score */ + score?: (number|null); + + /** WebEntity description */ + description?: (string|null); + } + + /** Represents a WebEntity. */ + class WebEntity implements IWebEntity { + + /** + * Constructs a new WebEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.WebDetection.IWebEntity); + + /** WebEntity entityId. */ + public entityId: string; + + /** WebEntity score. */ + public score: number; + + /** WebEntity description. */ + public description: string; + + /** + * Creates a new WebEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns WebEntity instance + */ + public static create(properties?: google.cloud.vision.v1.WebDetection.IWebEntity): google.cloud.vision.v1.WebDetection.WebEntity; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.WebDetection.WebEntity; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.WebDetection.WebEntity; + + /** + * Verifies a WebEntity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.WebDetection.WebEntity; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @param message WebEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.WebDetection.WebEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebImage. */ + interface IWebImage { + + /** WebImage url */ + url?: (string|null); + + /** WebImage score */ + score?: (number|null); + } + + /** Represents a WebImage. */ + class WebImage implements IWebImage { + + /** + * Constructs a new WebImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.WebDetection.IWebImage); + + /** WebImage url. */ + public url: string; + + /** WebImage score. */ + public score: number; + + /** + * Creates a new WebImage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebImage instance + */ + public static create(properties?: google.cloud.vision.v1.WebDetection.IWebImage): google.cloud.vision.v1.WebDetection.WebImage; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.WebDetection.WebImage; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.WebDetection.WebImage; + + /** + * Verifies a WebImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.WebDetection.WebImage; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @param message WebImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.WebDetection.WebImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebPage. */ + interface IWebPage { + + /** WebPage url */ + url?: (string|null); + + /** WebPage score */ + score?: (number|null); + + /** WebPage pageTitle */ + pageTitle?: (string|null); + + /** WebPage fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1.WebDetection.IWebImage[]|null); + + /** WebPage partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1.WebDetection.IWebImage[]|null); + } + + /** Represents a WebPage. */ + class WebPage implements IWebPage { + + /** + * Constructs a new WebPage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.WebDetection.IWebPage); + + /** WebPage url. */ + public url: string; + + /** WebPage score. */ + public score: number; + + /** WebPage pageTitle. */ + public pageTitle: string; + + /** WebPage fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1.WebDetection.IWebImage[]; + + /** WebPage partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1.WebDetection.IWebImage[]; + + /** + * Creates a new WebPage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebPage instance + */ + public static create(properties?: google.cloud.vision.v1.WebDetection.IWebPage): google.cloud.vision.v1.WebDetection.WebPage; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.WebDetection.WebPage; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.WebDetection.WebPage; + + /** + * Verifies a WebPage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebPage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.WebDetection.WebPage; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @param message WebPage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.WebDetection.WebPage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebPage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebLabel. */ + interface IWebLabel { + + /** WebLabel label */ + label?: (string|null); + + /** WebLabel languageCode */ + languageCode?: (string|null); + } + + /** Represents a WebLabel. */ + class WebLabel implements IWebLabel { + + /** + * Constructs a new WebLabel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1.WebDetection.IWebLabel); + + /** WebLabel label. */ + public label: string; + + /** WebLabel languageCode. */ + public languageCode: string; + + /** + * Creates a new WebLabel instance using the specified properties. + * @param [properties] Properties to set + * @returns WebLabel instance + */ + public static create(properties?: google.cloud.vision.v1.WebDetection.IWebLabel): google.cloud.vision.v1.WebDetection.WebLabel; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1.WebDetection.WebLabel; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1.WebDetection.WebLabel; + + /** + * Verifies a WebLabel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebLabel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1.WebDetection.WebLabel; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @param message WebLabel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1.WebDetection.WebLabel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebLabel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { + + /** Represents an ImageAnnotator */ + class ImageAnnotator extends $protobuf.rpc.Service { + + /** + * Constructs a new ImageAnnotator 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 ImageAnnotator 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): ImageAnnotator; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + */ + public batchAnnotateImages(request: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, callback: google.cloud.vision.v1p1beta1.ImageAnnotator.BatchAnnotateImagesCallback): void; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @returns Promise + */ + public batchAnnotateImages(request: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest): Promise; + } + + namespace ImageAnnotator { + + /** + * Callback as used by {@link google.cloud.vision.v1p1beta1.ImageAnnotator#batchAnnotateImages}. + * @param error Error, if any + * @param [response] BatchAnnotateImagesResponse + */ + type BatchAnnotateImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse) => void; + } + + /** Properties of a Feature. */ + interface IFeature { + + /** Feature type */ + type?: (google.cloud.vision.v1p1beta1.Feature.Type|null); + + /** Feature maxResults */ + maxResults?: (number|null); + + /** Feature model */ + model?: (string|null); + } + + /** Represents a Feature. */ + class Feature implements IFeature { + + /** + * Constructs a new Feature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IFeature); + + /** Feature type. */ + public type: google.cloud.vision.v1p1beta1.Feature.Type; + + /** Feature maxResults. */ + public maxResults: number; + + /** Feature model. */ + public model: string; + + /** + * Creates a new Feature instance using the specified properties. + * @param [properties] Properties to set + * @returns Feature instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IFeature): google.cloud.vision.v1p1beta1.Feature; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Feature; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Feature; + + /** + * Verifies a Feature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Feature; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @param message Feature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Feature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Feature { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + FACE_DETECTION = 1, + LANDMARK_DETECTION = 2, + LOGO_DETECTION = 3, + LABEL_DETECTION = 4, + TEXT_DETECTION = 5, + DOCUMENT_TEXT_DETECTION = 11, + SAFE_SEARCH_DETECTION = 6, + IMAGE_PROPERTIES = 7, + CROP_HINTS = 9, + WEB_DETECTION = 10 + } + } + + /** Properties of an ImageSource. */ + interface IImageSource { + + /** ImageSource gcsImageUri */ + gcsImageUri?: (string|null); + + /** ImageSource imageUri */ + imageUri?: (string|null); + } + + /** Represents an ImageSource. */ + class ImageSource implements IImageSource { + + /** + * Constructs a new ImageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IImageSource); + + /** ImageSource gcsImageUri. */ + public gcsImageUri: string; + + /** ImageSource imageUri. */ + public imageUri: string; + + /** + * Creates a new ImageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageSource instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IImageSource): google.cloud.vision.v1p1beta1.ImageSource; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.ImageSource; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.ImageSource; + + /** + * Verifies an ImageSource message. + * @param message Plain 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 ImageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.ImageSource; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @param message ImageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.ImageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image content */ + content?: (Uint8Array|null); + + /** Image source */ + source?: (google.cloud.vision.v1p1beta1.IImageSource|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IImage); + + /** Image content. */ + public content: Uint8Array; + + /** Image source. */ + public source?: (google.cloud.vision.v1p1beta1.IImageSource|null); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IImage): google.cloud.vision.v1p1beta1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FaceAnnotation. */ + interface IFaceAnnotation { + + /** FaceAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly */ + fdBoundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks */ + landmarks?: (google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark[]|null); + + /** FaceAnnotation rollAngle */ + rollAngle?: (number|null); + + /** FaceAnnotation panAngle */ + panAngle?: (number|null); + + /** FaceAnnotation tiltAngle */ + tiltAngle?: (number|null); + + /** FaceAnnotation detectionConfidence */ + detectionConfidence?: (number|null); + + /** FaceAnnotation landmarkingConfidence */ + landmarkingConfidence?: (number|null); + + /** FaceAnnotation joyLikelihood */ + joyLikelihood?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** FaceAnnotation sorrowLikelihood */ + sorrowLikelihood?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** FaceAnnotation angerLikelihood */ + angerLikelihood?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** FaceAnnotation surpriseLikelihood */ + surpriseLikelihood?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** FaceAnnotation underExposedLikelihood */ + underExposedLikelihood?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** FaceAnnotation blurredLikelihood */ + blurredLikelihood?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** FaceAnnotation headwearLikelihood */ + headwearLikelihood?: (google.cloud.vision.v1p1beta1.Likelihood|null); + } + + /** Represents a FaceAnnotation. */ + class FaceAnnotation implements IFaceAnnotation { + + /** + * Constructs a new FaceAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IFaceAnnotation); + + /** FaceAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly. */ + public fdBoundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks. */ + public landmarks: google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark[]; + + /** FaceAnnotation rollAngle. */ + public rollAngle: number; + + /** FaceAnnotation panAngle. */ + public panAngle: number; + + /** FaceAnnotation tiltAngle. */ + public tiltAngle: number; + + /** FaceAnnotation detectionConfidence. */ + public detectionConfidence: number; + + /** FaceAnnotation landmarkingConfidence. */ + public landmarkingConfidence: number; + + /** FaceAnnotation joyLikelihood. */ + public joyLikelihood: google.cloud.vision.v1p1beta1.Likelihood; + + /** FaceAnnotation sorrowLikelihood. */ + public sorrowLikelihood: google.cloud.vision.v1p1beta1.Likelihood; + + /** FaceAnnotation angerLikelihood. */ + public angerLikelihood: google.cloud.vision.v1p1beta1.Likelihood; + + /** FaceAnnotation surpriseLikelihood. */ + public surpriseLikelihood: google.cloud.vision.v1p1beta1.Likelihood; + + /** FaceAnnotation underExposedLikelihood. */ + public underExposedLikelihood: google.cloud.vision.v1p1beta1.Likelihood; + + /** FaceAnnotation blurredLikelihood. */ + public blurredLikelihood: google.cloud.vision.v1p1beta1.Likelihood; + + /** FaceAnnotation headwearLikelihood. */ + public headwearLikelihood: google.cloud.vision.v1p1beta1.Likelihood; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IFaceAnnotation): google.cloud.vision.v1p1beta1.FaceAnnotation; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.FaceAnnotation; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.FaceAnnotation; + + /** + * Verifies a FaceAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.FaceAnnotation; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @param message FaceAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.FaceAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FaceAnnotation { + + /** Properties of a Landmark. */ + interface ILandmark { + + /** Landmark type */ + type?: (google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type|null); + + /** Landmark position */ + position?: (google.cloud.vision.v1p1beta1.IPosition|null); + } + + /** Represents a Landmark. */ + class Landmark implements ILandmark { + + /** + * Constructs a new Landmark. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark); + + /** Landmark type. */ + public type: google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type; + + /** Landmark position. */ + public position?: (google.cloud.vision.v1p1beta1.IPosition|null); + + /** + * Creates a new Landmark instance using the specified properties. + * @param [properties] Properties to set + * @returns Landmark instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark): google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark; + + /** + * Verifies a Landmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Landmark + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @param message Landmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Landmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Landmark { + + /** Type enum. */ + enum Type { + UNKNOWN_LANDMARK = 0, + LEFT_EYE = 1, + RIGHT_EYE = 2, + LEFT_OF_LEFT_EYEBROW = 3, + RIGHT_OF_LEFT_EYEBROW = 4, + LEFT_OF_RIGHT_EYEBROW = 5, + RIGHT_OF_RIGHT_EYEBROW = 6, + MIDPOINT_BETWEEN_EYES = 7, + NOSE_TIP = 8, + UPPER_LIP = 9, + LOWER_LIP = 10, + MOUTH_LEFT = 11, + MOUTH_RIGHT = 12, + MOUTH_CENTER = 13, + NOSE_BOTTOM_RIGHT = 14, + NOSE_BOTTOM_LEFT = 15, + NOSE_BOTTOM_CENTER = 16, + LEFT_EYE_TOP_BOUNDARY = 17, + LEFT_EYE_RIGHT_CORNER = 18, + LEFT_EYE_BOTTOM_BOUNDARY = 19, + LEFT_EYE_LEFT_CORNER = 20, + RIGHT_EYE_TOP_BOUNDARY = 21, + RIGHT_EYE_RIGHT_CORNER = 22, + RIGHT_EYE_BOTTOM_BOUNDARY = 23, + RIGHT_EYE_LEFT_CORNER = 24, + LEFT_EYEBROW_UPPER_MIDPOINT = 25, + RIGHT_EYEBROW_UPPER_MIDPOINT = 26, + LEFT_EAR_TRAGION = 27, + RIGHT_EAR_TRAGION = 28, + LEFT_EYE_PUPIL = 29, + RIGHT_EYE_PUPIL = 30, + FOREHEAD_GLABELLA = 31, + CHIN_GNATHION = 32, + CHIN_LEFT_GONION = 33, + CHIN_RIGHT_GONION = 34 + } + } + } + + /** Properties of a LocationInfo. */ + interface ILocationInfo { + + /** LocationInfo latLng */ + latLng?: (google.type.ILatLng|null); + } + + /** Represents a LocationInfo. */ + class LocationInfo implements ILocationInfo { + + /** + * Constructs a new LocationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ILocationInfo); + + /** LocationInfo latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** + * Creates a new LocationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationInfo instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ILocationInfo): google.cloud.vision.v1p1beta1.LocationInfo; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p1beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.LocationInfo; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.LocationInfo; + + /** + * Verifies a LocationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.LocationInfo; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @param message LocationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Property. */ + interface IProperty { + + /** Property name */ + name?: (string|null); + + /** Property value */ + value?: (string|null); + + /** Property uint64Value */ + uint64Value?: (number|Long|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IProperty); + + /** Property name. */ + public name: string; + + /** Property value. */ + public value: string; + + /** Property uint64Value. */ + public uint64Value: (number|Long); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IProperty): google.cloud.vision.v1p1beta1.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Property message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Property; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Property; + + /** + * Verifies a Property message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Property + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Property; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @param message Property + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Property to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EntityAnnotation. */ + interface IEntityAnnotation { + + /** EntityAnnotation mid */ + mid?: (string|null); + + /** EntityAnnotation locale */ + locale?: (string|null); + + /** EntityAnnotation description */ + description?: (string|null); + + /** EntityAnnotation score */ + score?: (number|null); + + /** EntityAnnotation confidence */ + confidence?: (number|null); + + /** EntityAnnotation topicality */ + topicality?: (number|null); + + /** EntityAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** EntityAnnotation locations */ + locations?: (google.cloud.vision.v1p1beta1.ILocationInfo[]|null); + + /** EntityAnnotation properties */ + properties?: (google.cloud.vision.v1p1beta1.IProperty[]|null); + } + + /** Represents an EntityAnnotation. */ + class EntityAnnotation implements IEntityAnnotation { + + /** + * Constructs a new EntityAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IEntityAnnotation); + + /** EntityAnnotation mid. */ + public mid: string; + + /** EntityAnnotation locale. */ + public locale: string; + + /** EntityAnnotation description. */ + public description: string; + + /** EntityAnnotation score. */ + public score: number; + + /** EntityAnnotation confidence. */ + public confidence: number; + + /** EntityAnnotation topicality. */ + public topicality: number; + + /** EntityAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** EntityAnnotation locations. */ + public locations: google.cloud.vision.v1p1beta1.ILocationInfo[]; + + /** EntityAnnotation properties. */ + public properties: google.cloud.vision.v1p1beta1.IProperty[]; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IEntityAnnotation): google.cloud.vision.v1p1beta1.EntityAnnotation; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.EntityAnnotation; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.EntityAnnotation; + + /** + * Verifies an EntityAnnotation message. + * @param message Plain 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 EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.EntityAnnotation; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @param message EntityAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.EntityAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SafeSearchAnnotation. */ + interface ISafeSearchAnnotation { + + /** SafeSearchAnnotation adult */ + adult?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** SafeSearchAnnotation spoof */ + spoof?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** SafeSearchAnnotation medical */ + medical?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** SafeSearchAnnotation violence */ + violence?: (google.cloud.vision.v1p1beta1.Likelihood|null); + + /** SafeSearchAnnotation racy */ + racy?: (google.cloud.vision.v1p1beta1.Likelihood|null); + } + + /** Represents a SafeSearchAnnotation. */ + class SafeSearchAnnotation implements ISafeSearchAnnotation { + + /** + * Constructs a new SafeSearchAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ISafeSearchAnnotation); + + /** SafeSearchAnnotation adult. */ + public adult: google.cloud.vision.v1p1beta1.Likelihood; + + /** SafeSearchAnnotation spoof. */ + public spoof: google.cloud.vision.v1p1beta1.Likelihood; + + /** SafeSearchAnnotation medical. */ + public medical: google.cloud.vision.v1p1beta1.Likelihood; + + /** SafeSearchAnnotation violence. */ + public violence: google.cloud.vision.v1p1beta1.Likelihood; + + /** SafeSearchAnnotation racy. */ + public racy: google.cloud.vision.v1p1beta1.Likelihood; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns SafeSearchAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ISafeSearchAnnotation): google.cloud.vision.v1p1beta1.SafeSearchAnnotation; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.SafeSearchAnnotation; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.SafeSearchAnnotation; + + /** + * Verifies a SafeSearchAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafeSearchAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.SafeSearchAnnotation; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @param message SafeSearchAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.SafeSearchAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LatLongRect. */ + interface ILatLongRect { + + /** LatLongRect minLatLng */ + minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng */ + maxLatLng?: (google.type.ILatLng|null); + } + + /** Represents a LatLongRect. */ + class LatLongRect implements ILatLongRect { + + /** + * Constructs a new LatLongRect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ILatLongRect); + + /** LatLongRect minLatLng. */ + public minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng. */ + public maxLatLng?: (google.type.ILatLng|null); + + /** + * Creates a new LatLongRect instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLongRect instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ILatLongRect): google.cloud.vision.v1p1beta1.LatLongRect; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p1beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.LatLongRect; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.LatLongRect; + + /** + * Verifies a LatLongRect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLongRect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.LatLongRect; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @param message LatLongRect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.LatLongRect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLongRect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo color */ + color?: (google.type.IColor|null); + + /** ColorInfo score */ + score?: (number|null); + + /** ColorInfo pixelFraction */ + pixelFraction?: (number|null); + } + + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { + + /** + * Constructs a new ColorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IColorInfo); + + /** ColorInfo color. */ + public color?: (google.type.IColor|null); + + /** ColorInfo score. */ + public score: number; + + /** ColorInfo pixelFraction. */ + public pixelFraction: number; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColorInfo instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IColorInfo): google.cloud.vision.v1p1beta1.ColorInfo; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.ColorInfo; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.ColorInfo; + + /** + * Verifies a ColorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.ColorInfo; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DominantColorsAnnotation. */ + interface IDominantColorsAnnotation { + + /** DominantColorsAnnotation colors */ + colors?: (google.cloud.vision.v1p1beta1.IColorInfo[]|null); + } + + /** Represents a DominantColorsAnnotation. */ + class DominantColorsAnnotation implements IDominantColorsAnnotation { + + /** + * Constructs a new DominantColorsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IDominantColorsAnnotation); + + /** DominantColorsAnnotation colors. */ + public colors: google.cloud.vision.v1p1beta1.IColorInfo[]; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns DominantColorsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IDominantColorsAnnotation): google.cloud.vision.v1p1beta1.DominantColorsAnnotation; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.DominantColorsAnnotation; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.DominantColorsAnnotation; + + /** + * Verifies a DominantColorsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DominantColorsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.DominantColorsAnnotation; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @param message DominantColorsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.DominantColorsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageProperties. */ + interface IImageProperties { + + /** ImageProperties dominantColors */ + dominantColors?: (google.cloud.vision.v1p1beta1.IDominantColorsAnnotation|null); + } + + /** Represents an ImageProperties. */ + class ImageProperties implements IImageProperties { + + /** + * Constructs a new ImageProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IImageProperties); + + /** ImageProperties dominantColors. */ + public dominantColors?: (google.cloud.vision.v1p1beta1.IDominantColorsAnnotation|null); + + /** + * Creates a new ImageProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageProperties instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IImageProperties): google.cloud.vision.v1p1beta1.ImageProperties; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.ImageProperties; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.ImageProperties; + + /** + * Verifies an ImageProperties message. + * @param message Plain 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 ImageProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.ImageProperties; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @param message ImageProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.ImageProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHint. */ + interface ICropHint { + + /** CropHint boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** CropHint confidence */ + confidence?: (number|null); + + /** CropHint importanceFraction */ + importanceFraction?: (number|null); + } + + /** Represents a CropHint. */ + class CropHint implements ICropHint { + + /** + * Constructs a new CropHint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ICropHint); + + /** CropHint boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** CropHint confidence. */ + public confidence: number; + + /** CropHint importanceFraction. */ + public importanceFraction: number; + + /** + * Creates a new CropHint instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHint instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ICropHint): google.cloud.vision.v1p1beta1.CropHint; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.CropHint; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.CropHint; + + /** + * Verifies a CropHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.CropHint; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @param message CropHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.CropHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsAnnotation. */ + interface ICropHintsAnnotation { + + /** CropHintsAnnotation cropHints */ + cropHints?: (google.cloud.vision.v1p1beta1.ICropHint[]|null); + } + + /** Represents a CropHintsAnnotation. */ + class CropHintsAnnotation implements ICropHintsAnnotation { + + /** + * Constructs a new CropHintsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ICropHintsAnnotation); + + /** CropHintsAnnotation cropHints. */ + public cropHints: google.cloud.vision.v1p1beta1.ICropHint[]; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ICropHintsAnnotation): google.cloud.vision.v1p1beta1.CropHintsAnnotation; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.CropHintsAnnotation; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.CropHintsAnnotation; + + /** + * Verifies a CropHintsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.CropHintsAnnotation; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @param message CropHintsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.CropHintsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsParams. */ + interface ICropHintsParams { + + /** CropHintsParams aspectRatios */ + aspectRatios?: (number[]|null); + } + + /** Represents a CropHintsParams. */ + class CropHintsParams implements ICropHintsParams { + + /** + * Constructs a new CropHintsParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ICropHintsParams); + + /** CropHintsParams aspectRatios. */ + public aspectRatios: number[]; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsParams instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ICropHintsParams): google.cloud.vision.v1p1beta1.CropHintsParams; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.CropHintsParams; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.CropHintsParams; + + /** + * Verifies a CropHintsParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.CropHintsParams; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @param message CropHintsParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.CropHintsParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetectionParams. */ + interface IWebDetectionParams { + + /** WebDetectionParams includeGeoResults */ + includeGeoResults?: (boolean|null); + } + + /** Represents a WebDetectionParams. */ + class WebDetectionParams implements IWebDetectionParams { + + /** + * Constructs a new WebDetectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IWebDetectionParams); + + /** WebDetectionParams includeGeoResults. */ + public includeGeoResults: boolean; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetectionParams instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IWebDetectionParams): google.cloud.vision.v1p1beta1.WebDetectionParams; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.WebDetectionParams; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.WebDetectionParams; + + /** + * Verifies a WebDetectionParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.WebDetectionParams; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @param message WebDetectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.WebDetectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageContext. */ + interface IImageContext { + + /** ImageContext latLongRect */ + latLongRect?: (google.cloud.vision.v1p1beta1.ILatLongRect|null); + + /** ImageContext languageHints */ + languageHints?: (string[]|null); + + /** ImageContext cropHintsParams */ + cropHintsParams?: (google.cloud.vision.v1p1beta1.ICropHintsParams|null); + + /** ImageContext webDetectionParams */ + webDetectionParams?: (google.cloud.vision.v1p1beta1.IWebDetectionParams|null); + } + + /** Represents an ImageContext. */ + class ImageContext implements IImageContext { + + /** + * Constructs a new ImageContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IImageContext); + + /** ImageContext latLongRect. */ + public latLongRect?: (google.cloud.vision.v1p1beta1.ILatLongRect|null); + + /** ImageContext languageHints. */ + public languageHints: string[]; + + /** ImageContext cropHintsParams. */ + public cropHintsParams?: (google.cloud.vision.v1p1beta1.ICropHintsParams|null); + + /** ImageContext webDetectionParams. */ + public webDetectionParams?: (google.cloud.vision.v1p1beta1.IWebDetectionParams|null); + + /** + * Creates a new ImageContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageContext instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IImageContext): google.cloud.vision.v1p1beta1.ImageContext; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.ImageContext; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.ImageContext; + + /** + * Verifies an ImageContext message. + * @param message Plain 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 ImageContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.ImageContext; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @param message ImageContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.ImageContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageRequest. */ + interface IAnnotateImageRequest { + + /** AnnotateImageRequest image */ + image?: (google.cloud.vision.v1p1beta1.IImage|null); + + /** AnnotateImageRequest features */ + features?: (google.cloud.vision.v1p1beta1.IFeature[]|null); + + /** AnnotateImageRequest imageContext */ + imageContext?: (google.cloud.vision.v1p1beta1.IImageContext|null); + } + + /** Represents an AnnotateImageRequest. */ + class AnnotateImageRequest implements IAnnotateImageRequest { + + /** + * Constructs a new AnnotateImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IAnnotateImageRequest); + + /** AnnotateImageRequest image. */ + public image?: (google.cloud.vision.v1p1beta1.IImage|null); + + /** AnnotateImageRequest features. */ + public features: google.cloud.vision.v1p1beta1.IFeature[]; + + /** AnnotateImageRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p1beta1.IImageContext|null); + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IAnnotateImageRequest): google.cloud.vision.v1p1beta1.AnnotateImageRequest; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.AnnotateImageRequest; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.AnnotateImageRequest; + + /** + * Verifies an AnnotateImageRequest message. + * @param message Plain 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 AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.AnnotateImageRequest; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @param message AnnotateImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.AnnotateImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageResponse. */ + interface IAnnotateImageResponse { + + /** AnnotateImageResponse faceAnnotations */ + faceAnnotations?: (google.cloud.vision.v1p1beta1.IFaceAnnotation[]|null); + + /** AnnotateImageResponse landmarkAnnotations */ + landmarkAnnotations?: (google.cloud.vision.v1p1beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse logoAnnotations */ + logoAnnotations?: (google.cloud.vision.v1p1beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse labelAnnotations */ + labelAnnotations?: (google.cloud.vision.v1p1beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse textAnnotations */ + textAnnotations?: (google.cloud.vision.v1p1beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse fullTextAnnotation */ + fullTextAnnotation?: (google.cloud.vision.v1p1beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation */ + safeSearchAnnotation?: (google.cloud.vision.v1p1beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation */ + imagePropertiesAnnotation?: (google.cloud.vision.v1p1beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation */ + cropHintsAnnotation?: (google.cloud.vision.v1p1beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection */ + webDetection?: (google.cloud.vision.v1p1beta1.IWebDetection|null); + + /** AnnotateImageResponse error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents an AnnotateImageResponse. */ + class AnnotateImageResponse implements IAnnotateImageResponse { + + /** + * Constructs a new AnnotateImageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IAnnotateImageResponse); + + /** AnnotateImageResponse faceAnnotations. */ + public faceAnnotations: google.cloud.vision.v1p1beta1.IFaceAnnotation[]; + + /** AnnotateImageResponse landmarkAnnotations. */ + public landmarkAnnotations: google.cloud.vision.v1p1beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse logoAnnotations. */ + public logoAnnotations: google.cloud.vision.v1p1beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse labelAnnotations. */ + public labelAnnotations: google.cloud.vision.v1p1beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse textAnnotations. */ + public textAnnotations: google.cloud.vision.v1p1beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse fullTextAnnotation. */ + public fullTextAnnotation?: (google.cloud.vision.v1p1beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation. */ + public safeSearchAnnotation?: (google.cloud.vision.v1p1beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation. */ + public imagePropertiesAnnotation?: (google.cloud.vision.v1p1beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation. */ + public cropHintsAnnotation?: (google.cloud.vision.v1p1beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection. */ + public webDetection?: (google.cloud.vision.v1p1beta1.IWebDetection|null); + + /** AnnotateImageResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageResponse instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IAnnotateImageResponse): google.cloud.vision.v1p1beta1.AnnotateImageResponse; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.AnnotateImageResponse; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.AnnotateImageResponse; + + /** + * Verifies an AnnotateImageResponse message. + * @param message Plain 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 AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.AnnotateImageResponse; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @param message AnnotateImageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.AnnotateImageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesRequest. */ + interface IBatchAnnotateImagesRequest { + + /** BatchAnnotateImagesRequest requests */ + requests?: (google.cloud.vision.v1p1beta1.IAnnotateImageRequest[]|null); + } + + /** Represents a BatchAnnotateImagesRequest. */ + class BatchAnnotateImagesRequest implements IBatchAnnotateImagesRequest { + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest); + + /** BatchAnnotateImagesRequest requests. */ + public requests: google.cloud.vision.v1p1beta1.IAnnotateImageRequest[]; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest): google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesResponse. */ + interface IBatchAnnotateImagesResponse { + + /** BatchAnnotateImagesResponse responses */ + responses?: (google.cloud.vision.v1p1beta1.IAnnotateImageResponse[]|null); + } + + /** Represents a BatchAnnotateImagesResponse. */ + class BatchAnnotateImagesResponse implements IBatchAnnotateImagesResponse { + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse); + + /** BatchAnnotateImagesResponse responses. */ + public responses: google.cloud.vision.v1p1beta1.IAnnotateImageResponse[]; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse): google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Likelihood enum. */ + enum Likelihood { + UNKNOWN = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + + /** Properties of a Vertex. */ + interface IVertex { + + /** Vertex x */ + x?: (number|null); + + /** Vertex y */ + y?: (number|null); + } + + /** Represents a Vertex. */ + class Vertex implements IVertex { + + /** + * Constructs a new Vertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IVertex); + + /** Vertex x. */ + public x: number; + + /** Vertex y. */ + public y: number; + + /** + * Creates a new Vertex instance using the specified properties. + * @param [properties] Properties to set + * @returns Vertex instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IVertex): google.cloud.vision.v1p1beta1.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Vertex; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Vertex; + + /** + * Verifies a Vertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Vertex; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @param message Vertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BoundingPoly. */ + interface IBoundingPoly { + + /** BoundingPoly vertices */ + vertices?: (google.cloud.vision.v1p1beta1.IVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.vision.v1p1beta1.IVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IBoundingPoly): google.cloud.vision.v1p1beta1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.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.vision.v1p1beta1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Position. */ + interface IPosition { + + /** Position x */ + x?: (number|null); + + /** Position y */ + y?: (number|null); + + /** Position z */ + z?: (number|null); + } + + /** Represents a Position. */ + class Position implements IPosition { + + /** + * Constructs a new Position. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IPosition); + + /** Position x. */ + public x: number; + + /** Position y. */ + public y: number; + + /** Position z. */ + public z: number; + + /** + * Creates a new Position instance using the specified properties. + * @param [properties] Properties to set + * @returns Position instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IPosition): google.cloud.vision.v1p1beta1.Position; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Position message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Position; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Position; + + /** + * Verifies a Position message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Position + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Position; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @param message Position + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Position, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Position to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation pages */ + pages?: (google.cloud.vision.v1p1beta1.IPage[]|null); + + /** TextAnnotation text */ + text?: (string|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ITextAnnotation); + + /** TextAnnotation pages. */ + public pages: google.cloud.vision.v1p1beta1.IPage[]; + + /** TextAnnotation text. */ + public text: string; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ITextAnnotation): google.cloud.vision.v1p1beta1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TextAnnotation { + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage; + + /** + * Verifies a DetectedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectedBreak. */ + interface IDetectedBreak { + + /** DetectedBreak type */ + type?: (google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType|null); + + /** DetectedBreak isPrefix */ + isPrefix?: (boolean|null); + } + + /** Represents a DetectedBreak. */ + class DetectedBreak implements IDetectedBreak { + + /** + * Constructs a new DetectedBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak); + + /** DetectedBreak type. */ + public type: google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType; + + /** DetectedBreak isPrefix. */ + public isPrefix: boolean; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedBreak instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak; + + /** + * Verifies a DetectedBreak message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedBreak + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @param message DetectedBreak + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DetectedBreak { + + /** BreakType enum. */ + enum BreakType { + UNKNOWN = 0, + SPACE = 1, + SURE_SPACE = 2, + EOL_SURE_SPACE = 3, + HYPHEN = 4, + LINE_BREAK = 5 + } + } + + /** Properties of a TextProperty. */ + interface ITextProperty { + + /** TextProperty detectedLanguages */ + detectedLanguages?: (google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage[]|null); + + /** TextProperty detectedBreak */ + detectedBreak?: (google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak|null); + } + + /** Represents a TextProperty. */ + class TextProperty implements ITextProperty { + + /** + * Constructs a new TextProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty); + + /** TextProperty detectedLanguages. */ + public detectedLanguages: google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage[]; + + /** TextProperty detectedBreak. */ + public detectedBreak?: (google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak|null); + + /** + * Creates a new TextProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns TextProperty instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty): google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty; + + /** + * Verifies a TextProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @param message TextProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Page. */ + interface IPage { + + /** Page property */ + property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Page width */ + width?: (number|null); + + /** Page height */ + height?: (number|null); + + /** Page blocks */ + blocks?: (google.cloud.vision.v1p1beta1.IBlock[]|null); + + /** Page confidence */ + confidence?: (number|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IPage); + + /** Page property. */ + public property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Page width. */ + public width: number; + + /** Page height. */ + public height: number; + + /** Page blocks. */ + public blocks: google.cloud.vision.v1p1beta1.IBlock[]; + + /** Page confidence. */ + public confidence: number; + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IPage): google.cloud.vision.v1p1beta1.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Page; + + /** + * Verifies a Page message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Block. */ + interface IBlock { + + /** Block property */ + property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox */ + boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Block paragraphs */ + paragraphs?: (google.cloud.vision.v1p1beta1.IParagraph[]|null); + + /** Block blockType */ + blockType?: (google.cloud.vision.v1p1beta1.Block.BlockType|null); + + /** Block confidence */ + confidence?: (number|null); + } + + /** Represents a Block. */ + class Block implements IBlock { + + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IBlock); + + /** Block property. */ + public property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Block paragraphs. */ + public paragraphs: google.cloud.vision.v1p1beta1.IParagraph[]; + + /** Block blockType. */ + public blockType: google.cloud.vision.v1p1beta1.Block.BlockType; + + /** Block confidence. */ + public confidence: number; + + /** + * Creates a new Block instance using the specified properties. + * @param [properties] Properties to set + * @returns Block instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IBlock): google.cloud.vision.v1p1beta1.Block; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Block message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Block; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Block; + + /** + * Verifies a Block message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Block + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Block; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @param message Block + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Block to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Block { + + /** BlockType enum. */ + enum BlockType { + UNKNOWN = 0, + TEXT = 1, + TABLE = 2, + PICTURE = 3, + RULER = 4, + BARCODE = 5 + } + } + + /** Properties of a Paragraph. */ + interface IParagraph { + + /** Paragraph property */ + property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox */ + boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Paragraph words */ + words?: (google.cloud.vision.v1p1beta1.IWord[]|null); + + /** Paragraph confidence */ + confidence?: (number|null); + } + + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { + + /** + * Constructs a new Paragraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IParagraph); + + /** Paragraph property. */ + public property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Paragraph words. */ + public words: google.cloud.vision.v1p1beta1.IWord[]; + + /** Paragraph confidence. */ + public confidence: number; + + /** + * Creates a new Paragraph instance using the specified properties. + * @param [properties] Properties to set + * @returns Paragraph instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IParagraph): google.cloud.vision.v1p1beta1.Paragraph; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Paragraph; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Paragraph; + + /** + * Verifies a Paragraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Paragraph + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Paragraph; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @param message Paragraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Paragraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Word. */ + interface IWord { + + /** Word property */ + property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox */ + boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Word symbols */ + symbols?: (google.cloud.vision.v1p1beta1.ISymbol[]|null); + + /** Word confidence */ + confidence?: (number|null); + } + + /** Represents a Word. */ + class Word implements IWord { + + /** + * Constructs a new Word. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IWord); + + /** Word property. */ + public property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Word symbols. */ + public symbols: google.cloud.vision.v1p1beta1.ISymbol[]; + + /** Word confidence. */ + public confidence: number; + + /** + * Creates a new Word instance using the specified properties. + * @param [properties] Properties to set + * @returns Word instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IWord): google.cloud.vision.v1p1beta1.Word; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Word message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Word; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Word; + + /** + * Verifies a Word message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Word + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Word; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @param message Word + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Word, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Word to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Symbol. */ + interface ISymbol { + + /** Symbol property */ + property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox */ + boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Symbol text */ + text?: (string|null); + + /** Symbol confidence */ + confidence?: (number|null); + } + + /** Represents a Symbol. */ + class Symbol implements ISymbol { + + /** + * Constructs a new Symbol. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.ISymbol); + + /** Symbol property. */ + public property?: (google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p1beta1.IBoundingPoly|null); + + /** Symbol text. */ + public text: string; + + /** Symbol confidence. */ + public confidence: number; + + /** + * Creates a new Symbol instance using the specified properties. + * @param [properties] Properties to set + * @returns Symbol instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.ISymbol): google.cloud.vision.v1p1beta1.Symbol; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.Symbol; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.Symbol; + + /** + * Verifies a Symbol message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Symbol + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.Symbol; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @param message Symbol + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Symbol to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetection. */ + interface IWebDetection { + + /** WebDetection webEntities */ + webEntities?: (google.cloud.vision.v1p1beta1.WebDetection.IWebEntity[]|null); + + /** WebDetection fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]|null); + + /** WebDetection partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]|null); + + /** WebDetection pagesWithMatchingImages */ + pagesWithMatchingImages?: (google.cloud.vision.v1p1beta1.WebDetection.IWebPage[]|null); + + /** WebDetection visuallySimilarImages */ + visuallySimilarImages?: (google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]|null); + + /** WebDetection bestGuessLabels */ + bestGuessLabels?: (google.cloud.vision.v1p1beta1.WebDetection.IWebLabel[]|null); + } + + /** Represents a WebDetection. */ + class WebDetection implements IWebDetection { + + /** + * Constructs a new WebDetection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.IWebDetection); + + /** WebDetection webEntities. */ + public webEntities: google.cloud.vision.v1p1beta1.WebDetection.IWebEntity[]; + + /** WebDetection fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]; + + /** WebDetection partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]; + + /** WebDetection pagesWithMatchingImages. */ + public pagesWithMatchingImages: google.cloud.vision.v1p1beta1.WebDetection.IWebPage[]; + + /** WebDetection visuallySimilarImages. */ + public visuallySimilarImages: google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]; + + /** WebDetection bestGuessLabels. */ + public bestGuessLabels: google.cloud.vision.v1p1beta1.WebDetection.IWebLabel[]; + + /** + * Creates a new WebDetection instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetection instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.IWebDetection): google.cloud.vision.v1p1beta1.WebDetection; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.WebDetection; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.WebDetection; + + /** + * Verifies a WebDetection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.WebDetection; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @param message WebDetection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.WebDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WebDetection { + + /** Properties of a WebEntity. */ + interface IWebEntity { + + /** WebEntity entityId */ + entityId?: (string|null); + + /** WebEntity score */ + score?: (number|null); + + /** WebEntity description */ + description?: (string|null); + } + + /** Represents a WebEntity. */ + class WebEntity implements IWebEntity { + + /** + * Constructs a new WebEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebEntity); + + /** WebEntity entityId. */ + public entityId: string; + + /** WebEntity score. */ + public score: number; + + /** WebEntity description. */ + public description: string; + + /** + * Creates a new WebEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns WebEntity instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebEntity): google.cloud.vision.v1p1beta1.WebDetection.WebEntity; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.WebDetection.WebEntity; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.WebDetection.WebEntity; + + /** + * Verifies a WebEntity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.WebDetection.WebEntity; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @param message WebEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.WebDetection.WebEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebImage. */ + interface IWebImage { + + /** WebImage url */ + url?: (string|null); + + /** WebImage score */ + score?: (number|null); + } + + /** Represents a WebImage. */ + class WebImage implements IWebImage { + + /** + * Constructs a new WebImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebImage); + + /** WebImage url. */ + public url: string; + + /** WebImage score. */ + public score: number; + + /** + * Creates a new WebImage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebImage instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebImage): google.cloud.vision.v1p1beta1.WebDetection.WebImage; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.WebDetection.WebImage; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.WebDetection.WebImage; + + /** + * Verifies a WebImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.WebDetection.WebImage; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @param message WebImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.WebDetection.WebImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebPage. */ + interface IWebPage { + + /** WebPage url */ + url?: (string|null); + + /** WebPage score */ + score?: (number|null); + + /** WebPage pageTitle */ + pageTitle?: (string|null); + + /** WebPage fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]|null); + + /** WebPage partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]|null); + } + + /** Represents a WebPage. */ + class WebPage implements IWebPage { + + /** + * Constructs a new WebPage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebPage); + + /** WebPage url. */ + public url: string; + + /** WebPage score. */ + public score: number; + + /** WebPage pageTitle. */ + public pageTitle: string; + + /** WebPage fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]; + + /** WebPage partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p1beta1.WebDetection.IWebImage[]; + + /** + * Creates a new WebPage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebPage instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebPage): google.cloud.vision.v1p1beta1.WebDetection.WebPage; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.WebDetection.WebPage; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.WebDetection.WebPage; + + /** + * Verifies a WebPage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebPage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.WebDetection.WebPage; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @param message WebPage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.WebDetection.WebPage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebPage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebLabel. */ + interface IWebLabel { + + /** WebLabel label */ + label?: (string|null); + + /** WebLabel languageCode */ + languageCode?: (string|null); + } + + /** Represents a WebLabel. */ + class WebLabel implements IWebLabel { + + /** + * Constructs a new WebLabel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebLabel); + + /** WebLabel label. */ + public label: string; + + /** WebLabel languageCode. */ + public languageCode: string; + + /** + * Creates a new WebLabel instance using the specified properties. + * @param [properties] Properties to set + * @returns WebLabel instance + */ + public static create(properties?: google.cloud.vision.v1p1beta1.WebDetection.IWebLabel): google.cloud.vision.v1p1beta1.WebDetection.WebLabel; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p1beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p1beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p1beta1.WebDetection.WebLabel; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p1beta1.WebDetection.WebLabel; + + /** + * Verifies a WebLabel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebLabel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p1beta1.WebDetection.WebLabel; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @param message WebLabel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p1beta1.WebDetection.WebLabel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebLabel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Namespace v1p2beta1. */ + namespace v1p2beta1 { + + /** Represents an ImageAnnotator */ + class ImageAnnotator extends $protobuf.rpc.Service { + + /** + * Constructs a new ImageAnnotator 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 ImageAnnotator 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): ImageAnnotator; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + */ + public batchAnnotateImages(request: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, callback: google.cloud.vision.v1p2beta1.ImageAnnotator.BatchAnnotateImagesCallback): void; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @returns Promise + */ + public batchAnnotateImages(request: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest): Promise; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, callback: google.cloud.vision.v1p2beta1.ImageAnnotator.AsyncBatchAnnotateFilesCallback): void; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @returns Promise + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest): Promise; + } + + namespace ImageAnnotator { + + /** + * Callback as used by {@link google.cloud.vision.v1p2beta1.ImageAnnotator#batchAnnotateImages}. + * @param error Error, if any + * @param [response] BatchAnnotateImagesResponse + */ + type BatchAnnotateImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p2beta1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @param error Error, if any + * @param [response] Operation + */ + type AsyncBatchAnnotateFilesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Feature. */ + interface IFeature { + + /** Feature type */ + type?: (google.cloud.vision.v1p2beta1.Feature.Type|null); + + /** Feature maxResults */ + maxResults?: (number|null); + + /** Feature model */ + model?: (string|null); + } + + /** Represents a Feature. */ + class Feature implements IFeature { + + /** + * Constructs a new Feature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IFeature); + + /** Feature type. */ + public type: google.cloud.vision.v1p2beta1.Feature.Type; + + /** Feature maxResults. */ + public maxResults: number; + + /** Feature model. */ + public model: string; + + /** + * Creates a new Feature instance using the specified properties. + * @param [properties] Properties to set + * @returns Feature instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IFeature): google.cloud.vision.v1p2beta1.Feature; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Feature; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Feature; + + /** + * Verifies a Feature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Feature; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @param message Feature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Feature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Feature { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + FACE_DETECTION = 1, + LANDMARK_DETECTION = 2, + LOGO_DETECTION = 3, + LABEL_DETECTION = 4, + TEXT_DETECTION = 5, + DOCUMENT_TEXT_DETECTION = 11, + SAFE_SEARCH_DETECTION = 6, + IMAGE_PROPERTIES = 7, + CROP_HINTS = 9, + WEB_DETECTION = 10 + } + } + + /** Properties of an ImageSource. */ + interface IImageSource { + + /** ImageSource gcsImageUri */ + gcsImageUri?: (string|null); + + /** ImageSource imageUri */ + imageUri?: (string|null); + } + + /** Represents an ImageSource. */ + class ImageSource implements IImageSource { + + /** + * Constructs a new ImageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IImageSource); + + /** ImageSource gcsImageUri. */ + public gcsImageUri: string; + + /** ImageSource imageUri. */ + public imageUri: string; + + /** + * Creates a new ImageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageSource instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IImageSource): google.cloud.vision.v1p2beta1.ImageSource; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.ImageSource; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.ImageSource; + + /** + * Verifies an ImageSource message. + * @param message Plain 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 ImageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.ImageSource; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @param message ImageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.ImageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image content */ + content?: (Uint8Array|null); + + /** Image source */ + source?: (google.cloud.vision.v1p2beta1.IImageSource|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IImage); + + /** Image content. */ + public content: Uint8Array; + + /** Image source. */ + public source?: (google.cloud.vision.v1p2beta1.IImageSource|null); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IImage): google.cloud.vision.v1p2beta1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FaceAnnotation. */ + interface IFaceAnnotation { + + /** FaceAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly */ + fdBoundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks */ + landmarks?: (google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark[]|null); + + /** FaceAnnotation rollAngle */ + rollAngle?: (number|null); + + /** FaceAnnotation panAngle */ + panAngle?: (number|null); + + /** FaceAnnotation tiltAngle */ + tiltAngle?: (number|null); + + /** FaceAnnotation detectionConfidence */ + detectionConfidence?: (number|null); + + /** FaceAnnotation landmarkingConfidence */ + landmarkingConfidence?: (number|null); + + /** FaceAnnotation joyLikelihood */ + joyLikelihood?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** FaceAnnotation sorrowLikelihood */ + sorrowLikelihood?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** FaceAnnotation angerLikelihood */ + angerLikelihood?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** FaceAnnotation surpriseLikelihood */ + surpriseLikelihood?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** FaceAnnotation underExposedLikelihood */ + underExposedLikelihood?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** FaceAnnotation blurredLikelihood */ + blurredLikelihood?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** FaceAnnotation headwearLikelihood */ + headwearLikelihood?: (google.cloud.vision.v1p2beta1.Likelihood|null); + } + + /** Represents a FaceAnnotation. */ + class FaceAnnotation implements IFaceAnnotation { + + /** + * Constructs a new FaceAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IFaceAnnotation); + + /** FaceAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly. */ + public fdBoundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks. */ + public landmarks: google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark[]; + + /** FaceAnnotation rollAngle. */ + public rollAngle: number; + + /** FaceAnnotation panAngle. */ + public panAngle: number; + + /** FaceAnnotation tiltAngle. */ + public tiltAngle: number; + + /** FaceAnnotation detectionConfidence. */ + public detectionConfidence: number; + + /** FaceAnnotation landmarkingConfidence. */ + public landmarkingConfidence: number; + + /** FaceAnnotation joyLikelihood. */ + public joyLikelihood: google.cloud.vision.v1p2beta1.Likelihood; + + /** FaceAnnotation sorrowLikelihood. */ + public sorrowLikelihood: google.cloud.vision.v1p2beta1.Likelihood; + + /** FaceAnnotation angerLikelihood. */ + public angerLikelihood: google.cloud.vision.v1p2beta1.Likelihood; + + /** FaceAnnotation surpriseLikelihood. */ + public surpriseLikelihood: google.cloud.vision.v1p2beta1.Likelihood; + + /** FaceAnnotation underExposedLikelihood. */ + public underExposedLikelihood: google.cloud.vision.v1p2beta1.Likelihood; + + /** FaceAnnotation blurredLikelihood. */ + public blurredLikelihood: google.cloud.vision.v1p2beta1.Likelihood; + + /** FaceAnnotation headwearLikelihood. */ + public headwearLikelihood: google.cloud.vision.v1p2beta1.Likelihood; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IFaceAnnotation): google.cloud.vision.v1p2beta1.FaceAnnotation; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.FaceAnnotation; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.FaceAnnotation; + + /** + * Verifies a FaceAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.FaceAnnotation; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @param message FaceAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.FaceAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FaceAnnotation { + + /** Properties of a Landmark. */ + interface ILandmark { + + /** Landmark type */ + type?: (google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type|null); + + /** Landmark position */ + position?: (google.cloud.vision.v1p2beta1.IPosition|null); + } + + /** Represents a Landmark. */ + class Landmark implements ILandmark { + + /** + * Constructs a new Landmark. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark); + + /** Landmark type. */ + public type: google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type; + + /** Landmark position. */ + public position?: (google.cloud.vision.v1p2beta1.IPosition|null); + + /** + * Creates a new Landmark instance using the specified properties. + * @param [properties] Properties to set + * @returns Landmark instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark): google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark; + + /** + * Verifies a Landmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Landmark + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @param message Landmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Landmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Landmark { + + /** Type enum. */ + enum Type { + UNKNOWN_LANDMARK = 0, + LEFT_EYE = 1, + RIGHT_EYE = 2, + LEFT_OF_LEFT_EYEBROW = 3, + RIGHT_OF_LEFT_EYEBROW = 4, + LEFT_OF_RIGHT_EYEBROW = 5, + RIGHT_OF_RIGHT_EYEBROW = 6, + MIDPOINT_BETWEEN_EYES = 7, + NOSE_TIP = 8, + UPPER_LIP = 9, + LOWER_LIP = 10, + MOUTH_LEFT = 11, + MOUTH_RIGHT = 12, + MOUTH_CENTER = 13, + NOSE_BOTTOM_RIGHT = 14, + NOSE_BOTTOM_LEFT = 15, + NOSE_BOTTOM_CENTER = 16, + LEFT_EYE_TOP_BOUNDARY = 17, + LEFT_EYE_RIGHT_CORNER = 18, + LEFT_EYE_BOTTOM_BOUNDARY = 19, + LEFT_EYE_LEFT_CORNER = 20, + RIGHT_EYE_TOP_BOUNDARY = 21, + RIGHT_EYE_RIGHT_CORNER = 22, + RIGHT_EYE_BOTTOM_BOUNDARY = 23, + RIGHT_EYE_LEFT_CORNER = 24, + LEFT_EYEBROW_UPPER_MIDPOINT = 25, + RIGHT_EYEBROW_UPPER_MIDPOINT = 26, + LEFT_EAR_TRAGION = 27, + RIGHT_EAR_TRAGION = 28, + LEFT_EYE_PUPIL = 29, + RIGHT_EYE_PUPIL = 30, + FOREHEAD_GLABELLA = 31, + CHIN_GNATHION = 32, + CHIN_LEFT_GONION = 33, + CHIN_RIGHT_GONION = 34 + } + } + } + + /** Properties of a LocationInfo. */ + interface ILocationInfo { + + /** LocationInfo latLng */ + latLng?: (google.type.ILatLng|null); + } + + /** Represents a LocationInfo. */ + class LocationInfo implements ILocationInfo { + + /** + * Constructs a new LocationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ILocationInfo); + + /** LocationInfo latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** + * Creates a new LocationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationInfo instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ILocationInfo): google.cloud.vision.v1p2beta1.LocationInfo; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p2beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.LocationInfo; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.LocationInfo; + + /** + * Verifies a LocationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.LocationInfo; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @param message LocationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Property. */ + interface IProperty { + + /** Property name */ + name?: (string|null); + + /** Property value */ + value?: (string|null); + + /** Property uint64Value */ + uint64Value?: (number|Long|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IProperty); + + /** Property name. */ + public name: string; + + /** Property value. */ + public value: string; + + /** Property uint64Value. */ + public uint64Value: (number|Long); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IProperty): google.cloud.vision.v1p2beta1.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Property message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Property; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Property; + + /** + * Verifies a Property message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Property + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Property; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @param message Property + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Property to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EntityAnnotation. */ + interface IEntityAnnotation { + + /** EntityAnnotation mid */ + mid?: (string|null); + + /** EntityAnnotation locale */ + locale?: (string|null); + + /** EntityAnnotation description */ + description?: (string|null); + + /** EntityAnnotation score */ + score?: (number|null); + + /** EntityAnnotation confidence */ + confidence?: (number|null); + + /** EntityAnnotation topicality */ + topicality?: (number|null); + + /** EntityAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** EntityAnnotation locations */ + locations?: (google.cloud.vision.v1p2beta1.ILocationInfo[]|null); + + /** EntityAnnotation properties */ + properties?: (google.cloud.vision.v1p2beta1.IProperty[]|null); + } + + /** Represents an EntityAnnotation. */ + class EntityAnnotation implements IEntityAnnotation { + + /** + * Constructs a new EntityAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IEntityAnnotation); + + /** EntityAnnotation mid. */ + public mid: string; + + /** EntityAnnotation locale. */ + public locale: string; + + /** EntityAnnotation description. */ + public description: string; + + /** EntityAnnotation score. */ + public score: number; + + /** EntityAnnotation confidence. */ + public confidence: number; + + /** EntityAnnotation topicality. */ + public topicality: number; + + /** EntityAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** EntityAnnotation locations. */ + public locations: google.cloud.vision.v1p2beta1.ILocationInfo[]; + + /** EntityAnnotation properties. */ + public properties: google.cloud.vision.v1p2beta1.IProperty[]; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IEntityAnnotation): google.cloud.vision.v1p2beta1.EntityAnnotation; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.EntityAnnotation; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.EntityAnnotation; + + /** + * Verifies an EntityAnnotation message. + * @param message Plain 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 EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.EntityAnnotation; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @param message EntityAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.EntityAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SafeSearchAnnotation. */ + interface ISafeSearchAnnotation { + + /** SafeSearchAnnotation adult */ + adult?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** SafeSearchAnnotation spoof */ + spoof?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** SafeSearchAnnotation medical */ + medical?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** SafeSearchAnnotation violence */ + violence?: (google.cloud.vision.v1p2beta1.Likelihood|null); + + /** SafeSearchAnnotation racy */ + racy?: (google.cloud.vision.v1p2beta1.Likelihood|null); + } + + /** Represents a SafeSearchAnnotation. */ + class SafeSearchAnnotation implements ISafeSearchAnnotation { + + /** + * Constructs a new SafeSearchAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ISafeSearchAnnotation); + + /** SafeSearchAnnotation adult. */ + public adult: google.cloud.vision.v1p2beta1.Likelihood; + + /** SafeSearchAnnotation spoof. */ + public spoof: google.cloud.vision.v1p2beta1.Likelihood; + + /** SafeSearchAnnotation medical. */ + public medical: google.cloud.vision.v1p2beta1.Likelihood; + + /** SafeSearchAnnotation violence. */ + public violence: google.cloud.vision.v1p2beta1.Likelihood; + + /** SafeSearchAnnotation racy. */ + public racy: google.cloud.vision.v1p2beta1.Likelihood; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns SafeSearchAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ISafeSearchAnnotation): google.cloud.vision.v1p2beta1.SafeSearchAnnotation; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.SafeSearchAnnotation; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.SafeSearchAnnotation; + + /** + * Verifies a SafeSearchAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafeSearchAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.SafeSearchAnnotation; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @param message SafeSearchAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.SafeSearchAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LatLongRect. */ + interface ILatLongRect { + + /** LatLongRect minLatLng */ + minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng */ + maxLatLng?: (google.type.ILatLng|null); + } + + /** Represents a LatLongRect. */ + class LatLongRect implements ILatLongRect { + + /** + * Constructs a new LatLongRect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ILatLongRect); + + /** LatLongRect minLatLng. */ + public minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng. */ + public maxLatLng?: (google.type.ILatLng|null); + + /** + * Creates a new LatLongRect instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLongRect instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ILatLongRect): google.cloud.vision.v1p2beta1.LatLongRect; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p2beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.LatLongRect; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.LatLongRect; + + /** + * Verifies a LatLongRect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLongRect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.LatLongRect; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @param message LatLongRect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.LatLongRect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLongRect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo color */ + color?: (google.type.IColor|null); + + /** ColorInfo score */ + score?: (number|null); + + /** ColorInfo pixelFraction */ + pixelFraction?: (number|null); + } + + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { + + /** + * Constructs a new ColorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IColorInfo); + + /** ColorInfo color. */ + public color?: (google.type.IColor|null); + + /** ColorInfo score. */ + public score: number; + + /** ColorInfo pixelFraction. */ + public pixelFraction: number; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColorInfo instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IColorInfo): google.cloud.vision.v1p2beta1.ColorInfo; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.ColorInfo; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.ColorInfo; + + /** + * Verifies a ColorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.ColorInfo; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DominantColorsAnnotation. */ + interface IDominantColorsAnnotation { + + /** DominantColorsAnnotation colors */ + colors?: (google.cloud.vision.v1p2beta1.IColorInfo[]|null); + } + + /** Represents a DominantColorsAnnotation. */ + class DominantColorsAnnotation implements IDominantColorsAnnotation { + + /** + * Constructs a new DominantColorsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IDominantColorsAnnotation); + + /** DominantColorsAnnotation colors. */ + public colors: google.cloud.vision.v1p2beta1.IColorInfo[]; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns DominantColorsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IDominantColorsAnnotation): google.cloud.vision.v1p2beta1.DominantColorsAnnotation; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.DominantColorsAnnotation; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.DominantColorsAnnotation; + + /** + * Verifies a DominantColorsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DominantColorsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.DominantColorsAnnotation; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @param message DominantColorsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.DominantColorsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageProperties. */ + interface IImageProperties { + + /** ImageProperties dominantColors */ + dominantColors?: (google.cloud.vision.v1p2beta1.IDominantColorsAnnotation|null); + } + + /** Represents an ImageProperties. */ + class ImageProperties implements IImageProperties { + + /** + * Constructs a new ImageProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IImageProperties); + + /** ImageProperties dominantColors. */ + public dominantColors?: (google.cloud.vision.v1p2beta1.IDominantColorsAnnotation|null); + + /** + * Creates a new ImageProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageProperties instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IImageProperties): google.cloud.vision.v1p2beta1.ImageProperties; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.ImageProperties; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.ImageProperties; + + /** + * Verifies an ImageProperties message. + * @param message Plain 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 ImageProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.ImageProperties; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @param message ImageProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.ImageProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHint. */ + interface ICropHint { + + /** CropHint boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** CropHint confidence */ + confidence?: (number|null); + + /** CropHint importanceFraction */ + importanceFraction?: (number|null); + } + + /** Represents a CropHint. */ + class CropHint implements ICropHint { + + /** + * Constructs a new CropHint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ICropHint); + + /** CropHint boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** CropHint confidence. */ + public confidence: number; + + /** CropHint importanceFraction. */ + public importanceFraction: number; + + /** + * Creates a new CropHint instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHint instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ICropHint): google.cloud.vision.v1p2beta1.CropHint; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.CropHint; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.CropHint; + + /** + * Verifies a CropHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.CropHint; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @param message CropHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.CropHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsAnnotation. */ + interface ICropHintsAnnotation { + + /** CropHintsAnnotation cropHints */ + cropHints?: (google.cloud.vision.v1p2beta1.ICropHint[]|null); + } + + /** Represents a CropHintsAnnotation. */ + class CropHintsAnnotation implements ICropHintsAnnotation { + + /** + * Constructs a new CropHintsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ICropHintsAnnotation); + + /** CropHintsAnnotation cropHints. */ + public cropHints: google.cloud.vision.v1p2beta1.ICropHint[]; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ICropHintsAnnotation): google.cloud.vision.v1p2beta1.CropHintsAnnotation; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.CropHintsAnnotation; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.CropHintsAnnotation; + + /** + * Verifies a CropHintsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.CropHintsAnnotation; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @param message CropHintsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.CropHintsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsParams. */ + interface ICropHintsParams { + + /** CropHintsParams aspectRatios */ + aspectRatios?: (number[]|null); + } + + /** Represents a CropHintsParams. */ + class CropHintsParams implements ICropHintsParams { + + /** + * Constructs a new CropHintsParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ICropHintsParams); + + /** CropHintsParams aspectRatios. */ + public aspectRatios: number[]; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsParams instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ICropHintsParams): google.cloud.vision.v1p2beta1.CropHintsParams; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.CropHintsParams; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.CropHintsParams; + + /** + * Verifies a CropHintsParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.CropHintsParams; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @param message CropHintsParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.CropHintsParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetectionParams. */ + interface IWebDetectionParams { + + /** WebDetectionParams includeGeoResults */ + includeGeoResults?: (boolean|null); + } + + /** Represents a WebDetectionParams. */ + class WebDetectionParams implements IWebDetectionParams { + + /** + * Constructs a new WebDetectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IWebDetectionParams); + + /** WebDetectionParams includeGeoResults. */ + public includeGeoResults: boolean; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetectionParams instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IWebDetectionParams): google.cloud.vision.v1p2beta1.WebDetectionParams; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.WebDetectionParams; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.WebDetectionParams; + + /** + * Verifies a WebDetectionParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.WebDetectionParams; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @param message WebDetectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.WebDetectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageContext. */ + interface IImageContext { + + /** ImageContext latLongRect */ + latLongRect?: (google.cloud.vision.v1p2beta1.ILatLongRect|null); + + /** ImageContext languageHints */ + languageHints?: (string[]|null); + + /** ImageContext cropHintsParams */ + cropHintsParams?: (google.cloud.vision.v1p2beta1.ICropHintsParams|null); + + /** ImageContext webDetectionParams */ + webDetectionParams?: (google.cloud.vision.v1p2beta1.IWebDetectionParams|null); + } + + /** Represents an ImageContext. */ + class ImageContext implements IImageContext { + + /** + * Constructs a new ImageContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IImageContext); + + /** ImageContext latLongRect. */ + public latLongRect?: (google.cloud.vision.v1p2beta1.ILatLongRect|null); + + /** ImageContext languageHints. */ + public languageHints: string[]; + + /** ImageContext cropHintsParams. */ + public cropHintsParams?: (google.cloud.vision.v1p2beta1.ICropHintsParams|null); + + /** ImageContext webDetectionParams. */ + public webDetectionParams?: (google.cloud.vision.v1p2beta1.IWebDetectionParams|null); + + /** + * Creates a new ImageContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageContext instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IImageContext): google.cloud.vision.v1p2beta1.ImageContext; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.ImageContext; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.ImageContext; + + /** + * Verifies an ImageContext message. + * @param message Plain 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 ImageContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.ImageContext; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @param message ImageContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.ImageContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageRequest. */ + interface IAnnotateImageRequest { + + /** AnnotateImageRequest image */ + image?: (google.cloud.vision.v1p2beta1.IImage|null); + + /** AnnotateImageRequest features */ + features?: (google.cloud.vision.v1p2beta1.IFeature[]|null); + + /** AnnotateImageRequest imageContext */ + imageContext?: (google.cloud.vision.v1p2beta1.IImageContext|null); + } + + /** Represents an AnnotateImageRequest. */ + class AnnotateImageRequest implements IAnnotateImageRequest { + + /** + * Constructs a new AnnotateImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IAnnotateImageRequest); + + /** AnnotateImageRequest image. */ + public image?: (google.cloud.vision.v1p2beta1.IImage|null); + + /** AnnotateImageRequest features. */ + public features: google.cloud.vision.v1p2beta1.IFeature[]; + + /** AnnotateImageRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p2beta1.IImageContext|null); + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IAnnotateImageRequest): google.cloud.vision.v1p2beta1.AnnotateImageRequest; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.AnnotateImageRequest; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.AnnotateImageRequest; + + /** + * Verifies an AnnotateImageRequest message. + * @param message Plain 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 AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.AnnotateImageRequest; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @param message AnnotateImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.AnnotateImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageAnnotationContext. */ + interface IImageAnnotationContext { + + /** ImageAnnotationContext uri */ + uri?: (string|null); + + /** ImageAnnotationContext pageNumber */ + pageNumber?: (number|null); + } + + /** Represents an ImageAnnotationContext. */ + class ImageAnnotationContext implements IImageAnnotationContext { + + /** + * Constructs a new ImageAnnotationContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IImageAnnotationContext); + + /** ImageAnnotationContext uri. */ + public uri: string; + + /** ImageAnnotationContext pageNumber. */ + public pageNumber: number; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageAnnotationContext instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IImageAnnotationContext): google.cloud.vision.v1p2beta1.ImageAnnotationContext; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.ImageAnnotationContext; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.ImageAnnotationContext; + + /** + * Verifies an ImageAnnotationContext message. + * @param message Plain 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 ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageAnnotationContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.ImageAnnotationContext; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @param message ImageAnnotationContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.ImageAnnotationContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageResponse. */ + interface IAnnotateImageResponse { + + /** AnnotateImageResponse faceAnnotations */ + faceAnnotations?: (google.cloud.vision.v1p2beta1.IFaceAnnotation[]|null); + + /** AnnotateImageResponse landmarkAnnotations */ + landmarkAnnotations?: (google.cloud.vision.v1p2beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse logoAnnotations */ + logoAnnotations?: (google.cloud.vision.v1p2beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse labelAnnotations */ + labelAnnotations?: (google.cloud.vision.v1p2beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse textAnnotations */ + textAnnotations?: (google.cloud.vision.v1p2beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse fullTextAnnotation */ + fullTextAnnotation?: (google.cloud.vision.v1p2beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation */ + safeSearchAnnotation?: (google.cloud.vision.v1p2beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation */ + imagePropertiesAnnotation?: (google.cloud.vision.v1p2beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation */ + cropHintsAnnotation?: (google.cloud.vision.v1p2beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection */ + webDetection?: (google.cloud.vision.v1p2beta1.IWebDetection|null); + + /** AnnotateImageResponse error */ + error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context */ + context?: (google.cloud.vision.v1p2beta1.IImageAnnotationContext|null); + } + + /** Represents an AnnotateImageResponse. */ + class AnnotateImageResponse implements IAnnotateImageResponse { + + /** + * Constructs a new AnnotateImageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IAnnotateImageResponse); + + /** AnnotateImageResponse faceAnnotations. */ + public faceAnnotations: google.cloud.vision.v1p2beta1.IFaceAnnotation[]; + + /** AnnotateImageResponse landmarkAnnotations. */ + public landmarkAnnotations: google.cloud.vision.v1p2beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse logoAnnotations. */ + public logoAnnotations: google.cloud.vision.v1p2beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse labelAnnotations. */ + public labelAnnotations: google.cloud.vision.v1p2beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse textAnnotations. */ + public textAnnotations: google.cloud.vision.v1p2beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse fullTextAnnotation. */ + public fullTextAnnotation?: (google.cloud.vision.v1p2beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation. */ + public safeSearchAnnotation?: (google.cloud.vision.v1p2beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation. */ + public imagePropertiesAnnotation?: (google.cloud.vision.v1p2beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation. */ + public cropHintsAnnotation?: (google.cloud.vision.v1p2beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection. */ + public webDetection?: (google.cloud.vision.v1p2beta1.IWebDetection|null); + + /** AnnotateImageResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context. */ + public context?: (google.cloud.vision.v1p2beta1.IImageAnnotationContext|null); + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageResponse instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IAnnotateImageResponse): google.cloud.vision.v1p2beta1.AnnotateImageResponse; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.AnnotateImageResponse; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.AnnotateImageResponse; + + /** + * Verifies an AnnotateImageResponse message. + * @param message Plain 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 AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.AnnotateImageResponse; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @param message AnnotateImageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.AnnotateImageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateFileResponse. */ + interface IAnnotateFileResponse { + + /** AnnotateFileResponse inputConfig */ + inputConfig?: (google.cloud.vision.v1p2beta1.IInputConfig|null); + + /** AnnotateFileResponse responses */ + responses?: (google.cloud.vision.v1p2beta1.IAnnotateImageResponse[]|null); + } + + /** Represents an AnnotateFileResponse. */ + class AnnotateFileResponse implements IAnnotateFileResponse { + + /** + * Constructs a new AnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IAnnotateFileResponse); + + /** AnnotateFileResponse inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p2beta1.IInputConfig|null); + + /** AnnotateFileResponse responses. */ + public responses: google.cloud.vision.v1p2beta1.IAnnotateImageResponse[]; + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IAnnotateFileResponse): google.cloud.vision.v1p2beta1.AnnotateFileResponse; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.AnnotateFileResponse; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.AnnotateFileResponse; + + /** + * Verifies an AnnotateFileResponse message. + * @param message Plain 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 AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.AnnotateFileResponse; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @param message AnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.AnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesRequest. */ + interface IBatchAnnotateImagesRequest { + + /** BatchAnnotateImagesRequest requests */ + requests?: (google.cloud.vision.v1p2beta1.IAnnotateImageRequest[]|null); + } + + /** Represents a BatchAnnotateImagesRequest. */ + class BatchAnnotateImagesRequest implements IBatchAnnotateImagesRequest { + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest); + + /** BatchAnnotateImagesRequest requests. */ + public requests: google.cloud.vision.v1p2beta1.IAnnotateImageRequest[]; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest): google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesResponse. */ + interface IBatchAnnotateImagesResponse { + + /** BatchAnnotateImagesResponse responses */ + responses?: (google.cloud.vision.v1p2beta1.IAnnotateImageResponse[]|null); + } + + /** Represents a BatchAnnotateImagesResponse. */ + class BatchAnnotateImagesResponse implements IBatchAnnotateImagesResponse { + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse); + + /** BatchAnnotateImagesResponse responses. */ + public responses: google.cloud.vision.v1p2beta1.IAnnotateImageResponse[]; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse): google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileRequest. */ + interface IAsyncAnnotateFileRequest { + + /** AsyncAnnotateFileRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1p2beta1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features */ + features?: (google.cloud.vision.v1p2beta1.IFeature[]|null); + + /** AsyncAnnotateFileRequest imageContext */ + imageContext?: (google.cloud.vision.v1p2beta1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig */ + outputConfig?: (google.cloud.vision.v1p2beta1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileRequest. */ + class AsyncAnnotateFileRequest implements IAsyncAnnotateFileRequest { + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest); + + /** AsyncAnnotateFileRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p2beta1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features. */ + public features: google.cloud.vision.v1p2beta1.IFeature[]; + + /** AsyncAnnotateFileRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p2beta1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p2beta1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileRequest instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest): google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @param message Plain 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 AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileResponse. */ + interface IAsyncAnnotateFileResponse { + + /** AsyncAnnotateFileResponse outputConfig */ + outputConfig?: (google.cloud.vision.v1p2beta1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileResponse. */ + class AsyncAnnotateFileResponse implements IAsyncAnnotateFileResponse { + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse); + + /** AsyncAnnotateFileResponse outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p2beta1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse): google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @param message Plain 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 AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesRequest. */ + interface IAsyncBatchAnnotateFilesRequest { + + /** AsyncBatchAnnotateFilesRequest requests */ + requests?: (google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest[]|null); + } + + /** Represents an AsyncBatchAnnotateFilesRequest. */ + class AsyncBatchAnnotateFilesRequest implements IAsyncBatchAnnotateFilesRequest { + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest); + + /** AsyncBatchAnnotateFilesRequest requests. */ + public requests: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest[]; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @param message Plain 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 AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesResponse. */ + interface IAsyncBatchAnnotateFilesResponse { + + /** AsyncBatchAnnotateFilesResponse responses */ + responses?: (google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse[]|null); + } + + /** Represents an AsyncBatchAnnotateFilesResponse. */ + class AsyncBatchAnnotateFilesResponse implements IAsyncBatchAnnotateFilesResponse { + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse); + + /** AsyncBatchAnnotateFilesResponse responses. */ + public responses: google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse[]; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @param message Plain 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 AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.vision.v1p2beta1.IGcsSource|null); + + /** InputConfig mimeType */ + mimeType?: (string|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.vision.v1p2beta1.IGcsSource|null); + + /** InputConfig mimeType. */ + public mimeType: string; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IInputConfig): google.cloud.vision.v1p2beta1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.vision.v1p2beta1.IGcsDestination|null); + + /** OutputConfig batchSize */ + batchSize?: (number|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.vision.v1p2beta1.IGcsDestination|null); + + /** OutputConfig batchSize. */ + public batchSize: number; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IOutputConfig): google.cloud.vision.v1p2beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource uri */ + uri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IGcsSource); + + /** GcsSource uri. */ + public uri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IGcsSource): google.cloud.vision.v1p2beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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 uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IGcsDestination): google.cloud.vision.v1p2beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata state */ + state?: (google.cloud.vision.v1p2beta1.OperationMetadata.State|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 OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IOperationMetadata); + + /** OperationMetadata state. */ + public state: google.cloud.vision.v1p2beta1.OperationMetadata.State; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IOperationMetadata): google.cloud.vision.v1p2beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p2beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATED = 1, + RUNNING = 2, + DONE = 3, + CANCELLED = 4 + } + } + + /** Likelihood enum. */ + enum Likelihood { + UNKNOWN = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + + /** Properties of a Vertex. */ + interface IVertex { + + /** Vertex x */ + x?: (number|null); + + /** Vertex y */ + y?: (number|null); + } + + /** Represents a Vertex. */ + class Vertex implements IVertex { + + /** + * Constructs a new Vertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IVertex); + + /** Vertex x. */ + public x: number; + + /** Vertex y. */ + public y: number; + + /** + * Creates a new Vertex instance using the specified properties. + * @param [properties] Properties to set + * @returns Vertex instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IVertex): google.cloud.vision.v1p2beta1.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Vertex; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Vertex; + + /** + * Verifies a Vertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Vertex; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @param message Vertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vertex 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.vision.v1p2beta1.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.vision.v1p2beta1.INormalizedVertex): google.cloud.vision.v1p2beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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 vertices */ + vertices?: (google.cloud.vision.v1p2beta1.IVertex[]|null); + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.vision.v1p2beta1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.vision.v1p2beta1.IVertex[]; + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.vision.v1p2beta1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IBoundingPoly): google.cloud.vision.v1p2beta1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Position. */ + interface IPosition { + + /** Position x */ + x?: (number|null); + + /** Position y */ + y?: (number|null); + + /** Position z */ + z?: (number|null); + } + + /** Represents a Position. */ + class Position implements IPosition { + + /** + * Constructs a new Position. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IPosition); + + /** Position x. */ + public x: number; + + /** Position y. */ + public y: number; + + /** Position z. */ + public z: number; + + /** + * Creates a new Position instance using the specified properties. + * @param [properties] Properties to set + * @returns Position instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IPosition): google.cloud.vision.v1p2beta1.Position; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Position message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Position; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Position; + + /** + * Verifies a Position message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Position + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Position; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @param message Position + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Position, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Position to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation pages */ + pages?: (google.cloud.vision.v1p2beta1.IPage[]|null); + + /** TextAnnotation text */ + text?: (string|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ITextAnnotation); + + /** TextAnnotation pages. */ + public pages: google.cloud.vision.v1p2beta1.IPage[]; + + /** TextAnnotation text. */ + public text: string; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ITextAnnotation): google.cloud.vision.v1p2beta1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TextAnnotation { + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage; + + /** + * Verifies a DetectedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectedBreak. */ + interface IDetectedBreak { + + /** DetectedBreak type */ + type?: (google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType|null); + + /** DetectedBreak isPrefix */ + isPrefix?: (boolean|null); + } + + /** Represents a DetectedBreak. */ + class DetectedBreak implements IDetectedBreak { + + /** + * Constructs a new DetectedBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak); + + /** DetectedBreak type. */ + public type: google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType; + + /** DetectedBreak isPrefix. */ + public isPrefix: boolean; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedBreak instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak; + + /** + * Verifies a DetectedBreak message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedBreak + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @param message DetectedBreak + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DetectedBreak { + + /** BreakType enum. */ + enum BreakType { + UNKNOWN = 0, + SPACE = 1, + SURE_SPACE = 2, + EOL_SURE_SPACE = 3, + HYPHEN = 4, + LINE_BREAK = 5 + } + } + + /** Properties of a TextProperty. */ + interface ITextProperty { + + /** TextProperty detectedLanguages */ + detectedLanguages?: (google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage[]|null); + + /** TextProperty detectedBreak */ + detectedBreak?: (google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak|null); + } + + /** Represents a TextProperty. */ + class TextProperty implements ITextProperty { + + /** + * Constructs a new TextProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty); + + /** TextProperty detectedLanguages. */ + public detectedLanguages: google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage[]; + + /** TextProperty detectedBreak. */ + public detectedBreak?: (google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak|null); + + /** + * Creates a new TextProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns TextProperty instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty): google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty; + + /** + * Verifies a TextProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @param message TextProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Page. */ + interface IPage { + + /** Page property */ + property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Page width */ + width?: (number|null); + + /** Page height */ + height?: (number|null); + + /** Page blocks */ + blocks?: (google.cloud.vision.v1p2beta1.IBlock[]|null); + + /** Page confidence */ + confidence?: (number|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IPage); + + /** Page property. */ + public property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Page width. */ + public width: number; + + /** Page height. */ + public height: number; + + /** Page blocks. */ + public blocks: google.cloud.vision.v1p2beta1.IBlock[]; + + /** Page confidence. */ + public confidence: number; + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IPage): google.cloud.vision.v1p2beta1.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Page; + + /** + * Verifies a Page message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Block. */ + interface IBlock { + + /** Block property */ + property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox */ + boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Block paragraphs */ + paragraphs?: (google.cloud.vision.v1p2beta1.IParagraph[]|null); + + /** Block blockType */ + blockType?: (google.cloud.vision.v1p2beta1.Block.BlockType|null); + + /** Block confidence */ + confidence?: (number|null); + } + + /** Represents a Block. */ + class Block implements IBlock { + + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IBlock); + + /** Block property. */ + public property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Block paragraphs. */ + public paragraphs: google.cloud.vision.v1p2beta1.IParagraph[]; + + /** Block blockType. */ + public blockType: google.cloud.vision.v1p2beta1.Block.BlockType; + + /** Block confidence. */ + public confidence: number; + + /** + * Creates a new Block instance using the specified properties. + * @param [properties] Properties to set + * @returns Block instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IBlock): google.cloud.vision.v1p2beta1.Block; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Block message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Block; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Block; + + /** + * Verifies a Block message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Block + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Block; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @param message Block + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Block to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Block { + + /** BlockType enum. */ + enum BlockType { + UNKNOWN = 0, + TEXT = 1, + TABLE = 2, + PICTURE = 3, + RULER = 4, + BARCODE = 5 + } + } + + /** Properties of a Paragraph. */ + interface IParagraph { + + /** Paragraph property */ + property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox */ + boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Paragraph words */ + words?: (google.cloud.vision.v1p2beta1.IWord[]|null); + + /** Paragraph confidence */ + confidence?: (number|null); + } + + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { + + /** + * Constructs a new Paragraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IParagraph); + + /** Paragraph property. */ + public property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Paragraph words. */ + public words: google.cloud.vision.v1p2beta1.IWord[]; + + /** Paragraph confidence. */ + public confidence: number; + + /** + * Creates a new Paragraph instance using the specified properties. + * @param [properties] Properties to set + * @returns Paragraph instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IParagraph): google.cloud.vision.v1p2beta1.Paragraph; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Paragraph; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Paragraph; + + /** + * Verifies a Paragraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Paragraph + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Paragraph; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @param message Paragraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Paragraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Word. */ + interface IWord { + + /** Word property */ + property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox */ + boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Word symbols */ + symbols?: (google.cloud.vision.v1p2beta1.ISymbol[]|null); + + /** Word confidence */ + confidence?: (number|null); + } + + /** Represents a Word. */ + class Word implements IWord { + + /** + * Constructs a new Word. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IWord); + + /** Word property. */ + public property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Word symbols. */ + public symbols: google.cloud.vision.v1p2beta1.ISymbol[]; + + /** Word confidence. */ + public confidence: number; + + /** + * Creates a new Word instance using the specified properties. + * @param [properties] Properties to set + * @returns Word instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IWord): google.cloud.vision.v1p2beta1.Word; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Word message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Word; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Word; + + /** + * Verifies a Word message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Word + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Word; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @param message Word + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Word, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Word to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Symbol. */ + interface ISymbol { + + /** Symbol property */ + property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox */ + boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Symbol text */ + text?: (string|null); + + /** Symbol confidence */ + confidence?: (number|null); + } + + /** Represents a Symbol. */ + class Symbol implements ISymbol { + + /** + * Constructs a new Symbol. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.ISymbol); + + /** Symbol property. */ + public property?: (google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p2beta1.IBoundingPoly|null); + + /** Symbol text. */ + public text: string; + + /** Symbol confidence. */ + public confidence: number; + + /** + * Creates a new Symbol instance using the specified properties. + * @param [properties] Properties to set + * @returns Symbol instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.ISymbol): google.cloud.vision.v1p2beta1.Symbol; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.Symbol; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.Symbol; + + /** + * Verifies a Symbol message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Symbol + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.Symbol; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @param message Symbol + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Symbol to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetection. */ + interface IWebDetection { + + /** WebDetection webEntities */ + webEntities?: (google.cloud.vision.v1p2beta1.WebDetection.IWebEntity[]|null); + + /** WebDetection fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]|null); + + /** WebDetection partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]|null); + + /** WebDetection pagesWithMatchingImages */ + pagesWithMatchingImages?: (google.cloud.vision.v1p2beta1.WebDetection.IWebPage[]|null); + + /** WebDetection visuallySimilarImages */ + visuallySimilarImages?: (google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]|null); + + /** WebDetection bestGuessLabels */ + bestGuessLabels?: (google.cloud.vision.v1p2beta1.WebDetection.IWebLabel[]|null); + } + + /** Represents a WebDetection. */ + class WebDetection implements IWebDetection { + + /** + * Constructs a new WebDetection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.IWebDetection); + + /** WebDetection webEntities. */ + public webEntities: google.cloud.vision.v1p2beta1.WebDetection.IWebEntity[]; + + /** WebDetection fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]; + + /** WebDetection partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]; + + /** WebDetection pagesWithMatchingImages. */ + public pagesWithMatchingImages: google.cloud.vision.v1p2beta1.WebDetection.IWebPage[]; + + /** WebDetection visuallySimilarImages. */ + public visuallySimilarImages: google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]; + + /** WebDetection bestGuessLabels. */ + public bestGuessLabels: google.cloud.vision.v1p2beta1.WebDetection.IWebLabel[]; + + /** + * Creates a new WebDetection instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetection instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.IWebDetection): google.cloud.vision.v1p2beta1.WebDetection; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.WebDetection; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.WebDetection; + + /** + * Verifies a WebDetection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.WebDetection; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @param message WebDetection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.WebDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WebDetection { + + /** Properties of a WebEntity. */ + interface IWebEntity { + + /** WebEntity entityId */ + entityId?: (string|null); + + /** WebEntity score */ + score?: (number|null); + + /** WebEntity description */ + description?: (string|null); + } + + /** Represents a WebEntity. */ + class WebEntity implements IWebEntity { + + /** + * Constructs a new WebEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebEntity); + + /** WebEntity entityId. */ + public entityId: string; + + /** WebEntity score. */ + public score: number; + + /** WebEntity description. */ + public description: string; + + /** + * Creates a new WebEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns WebEntity instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebEntity): google.cloud.vision.v1p2beta1.WebDetection.WebEntity; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.WebDetection.WebEntity; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.WebDetection.WebEntity; + + /** + * Verifies a WebEntity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.WebDetection.WebEntity; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @param message WebEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.WebDetection.WebEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebImage. */ + interface IWebImage { + + /** WebImage url */ + url?: (string|null); + + /** WebImage score */ + score?: (number|null); + } + + /** Represents a WebImage. */ + class WebImage implements IWebImage { + + /** + * Constructs a new WebImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebImage); + + /** WebImage url. */ + public url: string; + + /** WebImage score. */ + public score: number; + + /** + * Creates a new WebImage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebImage instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebImage): google.cloud.vision.v1p2beta1.WebDetection.WebImage; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.WebDetection.WebImage; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.WebDetection.WebImage; + + /** + * Verifies a WebImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.WebDetection.WebImage; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @param message WebImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.WebDetection.WebImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebPage. */ + interface IWebPage { + + /** WebPage url */ + url?: (string|null); + + /** WebPage score */ + score?: (number|null); + + /** WebPage pageTitle */ + pageTitle?: (string|null); + + /** WebPage fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]|null); + + /** WebPage partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]|null); + } + + /** Represents a WebPage. */ + class WebPage implements IWebPage { + + /** + * Constructs a new WebPage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebPage); + + /** WebPage url. */ + public url: string; + + /** WebPage score. */ + public score: number; + + /** WebPage pageTitle. */ + public pageTitle: string; + + /** WebPage fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]; + + /** WebPage partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p2beta1.WebDetection.IWebImage[]; + + /** + * Creates a new WebPage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebPage instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebPage): google.cloud.vision.v1p2beta1.WebDetection.WebPage; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.WebDetection.WebPage; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.WebDetection.WebPage; + + /** + * Verifies a WebPage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebPage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.WebDetection.WebPage; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @param message WebPage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.WebDetection.WebPage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebPage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebLabel. */ + interface IWebLabel { + + /** WebLabel label */ + label?: (string|null); + + /** WebLabel languageCode */ + languageCode?: (string|null); + } + + /** Represents a WebLabel. */ + class WebLabel implements IWebLabel { + + /** + * Constructs a new WebLabel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebLabel); + + /** WebLabel label. */ + public label: string; + + /** WebLabel languageCode. */ + public languageCode: string; + + /** + * Creates a new WebLabel instance using the specified properties. + * @param [properties] Properties to set + * @returns WebLabel instance + */ + public static create(properties?: google.cloud.vision.v1p2beta1.WebDetection.IWebLabel): google.cloud.vision.v1p2beta1.WebDetection.WebLabel; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p2beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p2beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p2beta1.WebDetection.WebLabel; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p2beta1.WebDetection.WebLabel; + + /** + * Verifies a WebLabel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebLabel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p2beta1.WebDetection.WebLabel; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @param message WebLabel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p2beta1.WebDetection.WebLabel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebLabel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Namespace v1p3beta1. */ + namespace v1p3beta1 { + + /** Represents an ImageAnnotator */ + class ImageAnnotator extends $protobuf.rpc.Service { + + /** + * Constructs a new ImageAnnotator 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 ImageAnnotator 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): ImageAnnotator; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + */ + public batchAnnotateImages(request: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, callback: google.cloud.vision.v1p3beta1.ImageAnnotator.BatchAnnotateImagesCallback): void; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @returns Promise + */ + public batchAnnotateImages(request: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest): Promise; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, callback: google.cloud.vision.v1p3beta1.ImageAnnotator.AsyncBatchAnnotateFilesCallback): void; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @returns Promise + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest): Promise; + } + + namespace ImageAnnotator { + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ImageAnnotator#batchAnnotateImages}. + * @param error Error, if any + * @param [response] BatchAnnotateImagesResponse + */ + type BatchAnnotateImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @param error Error, if any + * @param [response] Operation + */ + type AsyncBatchAnnotateFilesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Feature. */ + interface IFeature { + + /** Feature type */ + type?: (google.cloud.vision.v1p3beta1.Feature.Type|null); + + /** Feature maxResults */ + maxResults?: (number|null); + + /** Feature model */ + model?: (string|null); + } + + /** Represents a Feature. */ + class Feature implements IFeature { + + /** + * Constructs a new Feature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IFeature); + + /** Feature type. */ + public type: google.cloud.vision.v1p3beta1.Feature.Type; + + /** Feature maxResults. */ + public maxResults: number; + + /** Feature model. */ + public model: string; + + /** + * Creates a new Feature instance using the specified properties. + * @param [properties] Properties to set + * @returns Feature instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IFeature): google.cloud.vision.v1p3beta1.Feature; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Feature; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Feature; + + /** + * Verifies a Feature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Feature; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @param message Feature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Feature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Feature { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + FACE_DETECTION = 1, + LANDMARK_DETECTION = 2, + LOGO_DETECTION = 3, + LABEL_DETECTION = 4, + TEXT_DETECTION = 5, + DOCUMENT_TEXT_DETECTION = 11, + SAFE_SEARCH_DETECTION = 6, + IMAGE_PROPERTIES = 7, + CROP_HINTS = 9, + WEB_DETECTION = 10, + PRODUCT_SEARCH = 12, + OBJECT_LOCALIZATION = 19 + } + } + + /** Properties of an ImageSource. */ + interface IImageSource { + + /** ImageSource gcsImageUri */ + gcsImageUri?: (string|null); + + /** ImageSource imageUri */ + imageUri?: (string|null); + } + + /** Represents an ImageSource. */ + class ImageSource implements IImageSource { + + /** + * Constructs a new ImageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImageSource); + + /** ImageSource gcsImageUri. */ + public gcsImageUri: string; + + /** ImageSource imageUri. */ + public imageUri: string; + + /** + * Creates a new ImageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageSource instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImageSource): google.cloud.vision.v1p3beta1.ImageSource; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImageSource; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImageSource; + + /** + * Verifies an ImageSource message. + * @param message Plain 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 ImageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImageSource; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @param message ImageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image content */ + content?: (Uint8Array|null); + + /** Image source */ + source?: (google.cloud.vision.v1p3beta1.IImageSource|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImage); + + /** Image content. */ + public content: Uint8Array; + + /** Image source. */ + public source?: (google.cloud.vision.v1p3beta1.IImageSource|null); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImage): google.cloud.vision.v1p3beta1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FaceAnnotation. */ + interface IFaceAnnotation { + + /** FaceAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly */ + fdBoundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks */ + landmarks?: (google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark[]|null); + + /** FaceAnnotation rollAngle */ + rollAngle?: (number|null); + + /** FaceAnnotation panAngle */ + panAngle?: (number|null); + + /** FaceAnnotation tiltAngle */ + tiltAngle?: (number|null); + + /** FaceAnnotation detectionConfidence */ + detectionConfidence?: (number|null); + + /** FaceAnnotation landmarkingConfidence */ + landmarkingConfidence?: (number|null); + + /** FaceAnnotation joyLikelihood */ + joyLikelihood?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** FaceAnnotation sorrowLikelihood */ + sorrowLikelihood?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** FaceAnnotation angerLikelihood */ + angerLikelihood?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** FaceAnnotation surpriseLikelihood */ + surpriseLikelihood?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** FaceAnnotation underExposedLikelihood */ + underExposedLikelihood?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** FaceAnnotation blurredLikelihood */ + blurredLikelihood?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** FaceAnnotation headwearLikelihood */ + headwearLikelihood?: (google.cloud.vision.v1p3beta1.Likelihood|null); + } + + /** Represents a FaceAnnotation. */ + class FaceAnnotation implements IFaceAnnotation { + + /** + * Constructs a new FaceAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IFaceAnnotation); + + /** FaceAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly. */ + public fdBoundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks. */ + public landmarks: google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark[]; + + /** FaceAnnotation rollAngle. */ + public rollAngle: number; + + /** FaceAnnotation panAngle. */ + public panAngle: number; + + /** FaceAnnotation tiltAngle. */ + public tiltAngle: number; + + /** FaceAnnotation detectionConfidence. */ + public detectionConfidence: number; + + /** FaceAnnotation landmarkingConfidence. */ + public landmarkingConfidence: number; + + /** FaceAnnotation joyLikelihood. */ + public joyLikelihood: google.cloud.vision.v1p3beta1.Likelihood; + + /** FaceAnnotation sorrowLikelihood. */ + public sorrowLikelihood: google.cloud.vision.v1p3beta1.Likelihood; + + /** FaceAnnotation angerLikelihood. */ + public angerLikelihood: google.cloud.vision.v1p3beta1.Likelihood; + + /** FaceAnnotation surpriseLikelihood. */ + public surpriseLikelihood: google.cloud.vision.v1p3beta1.Likelihood; + + /** FaceAnnotation underExposedLikelihood. */ + public underExposedLikelihood: google.cloud.vision.v1p3beta1.Likelihood; + + /** FaceAnnotation blurredLikelihood. */ + public blurredLikelihood: google.cloud.vision.v1p3beta1.Likelihood; + + /** FaceAnnotation headwearLikelihood. */ + public headwearLikelihood: google.cloud.vision.v1p3beta1.Likelihood; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IFaceAnnotation): google.cloud.vision.v1p3beta1.FaceAnnotation; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.FaceAnnotation; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.FaceAnnotation; + + /** + * Verifies a FaceAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.FaceAnnotation; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @param message FaceAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.FaceAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FaceAnnotation { + + /** Properties of a Landmark. */ + interface ILandmark { + + /** Landmark type */ + type?: (google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type|null); + + /** Landmark position */ + position?: (google.cloud.vision.v1p3beta1.IPosition|null); + } + + /** Represents a Landmark. */ + class Landmark implements ILandmark { + + /** + * Constructs a new Landmark. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark); + + /** Landmark type. */ + public type: google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type; + + /** Landmark position. */ + public position?: (google.cloud.vision.v1p3beta1.IPosition|null); + + /** + * Creates a new Landmark instance using the specified properties. + * @param [properties] Properties to set + * @returns Landmark instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark): google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark; + + /** + * Verifies a Landmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Landmark + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @param message Landmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Landmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Landmark { + + /** Type enum. */ + enum Type { + UNKNOWN_LANDMARK = 0, + LEFT_EYE = 1, + RIGHT_EYE = 2, + LEFT_OF_LEFT_EYEBROW = 3, + RIGHT_OF_LEFT_EYEBROW = 4, + LEFT_OF_RIGHT_EYEBROW = 5, + RIGHT_OF_RIGHT_EYEBROW = 6, + MIDPOINT_BETWEEN_EYES = 7, + NOSE_TIP = 8, + UPPER_LIP = 9, + LOWER_LIP = 10, + MOUTH_LEFT = 11, + MOUTH_RIGHT = 12, + MOUTH_CENTER = 13, + NOSE_BOTTOM_RIGHT = 14, + NOSE_BOTTOM_LEFT = 15, + NOSE_BOTTOM_CENTER = 16, + LEFT_EYE_TOP_BOUNDARY = 17, + LEFT_EYE_RIGHT_CORNER = 18, + LEFT_EYE_BOTTOM_BOUNDARY = 19, + LEFT_EYE_LEFT_CORNER = 20, + RIGHT_EYE_TOP_BOUNDARY = 21, + RIGHT_EYE_RIGHT_CORNER = 22, + RIGHT_EYE_BOTTOM_BOUNDARY = 23, + RIGHT_EYE_LEFT_CORNER = 24, + LEFT_EYEBROW_UPPER_MIDPOINT = 25, + RIGHT_EYEBROW_UPPER_MIDPOINT = 26, + LEFT_EAR_TRAGION = 27, + RIGHT_EAR_TRAGION = 28, + LEFT_EYE_PUPIL = 29, + RIGHT_EYE_PUPIL = 30, + FOREHEAD_GLABELLA = 31, + CHIN_GNATHION = 32, + CHIN_LEFT_GONION = 33, + CHIN_RIGHT_GONION = 34 + } + } + } + + /** Properties of a LocationInfo. */ + interface ILocationInfo { + + /** LocationInfo latLng */ + latLng?: (google.type.ILatLng|null); + } + + /** Represents a LocationInfo. */ + class LocationInfo implements ILocationInfo { + + /** + * Constructs a new LocationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ILocationInfo); + + /** LocationInfo latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** + * Creates a new LocationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationInfo instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ILocationInfo): google.cloud.vision.v1p3beta1.LocationInfo; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.LocationInfo; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.LocationInfo; + + /** + * Verifies a LocationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.LocationInfo; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @param message LocationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Property. */ + interface IProperty { + + /** Property name */ + name?: (string|null); + + /** Property value */ + value?: (string|null); + + /** Property uint64Value */ + uint64Value?: (number|Long|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IProperty); + + /** Property name. */ + public name: string; + + /** Property value. */ + public value: string; + + /** Property uint64Value. */ + public uint64Value: (number|Long); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IProperty): google.cloud.vision.v1p3beta1.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Property message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Property; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Property; + + /** + * Verifies a Property message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Property + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Property; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @param message Property + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Property to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EntityAnnotation. */ + interface IEntityAnnotation { + + /** EntityAnnotation mid */ + mid?: (string|null); + + /** EntityAnnotation locale */ + locale?: (string|null); + + /** EntityAnnotation description */ + description?: (string|null); + + /** EntityAnnotation score */ + score?: (number|null); + + /** EntityAnnotation confidence */ + confidence?: (number|null); + + /** EntityAnnotation topicality */ + topicality?: (number|null); + + /** EntityAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** EntityAnnotation locations */ + locations?: (google.cloud.vision.v1p3beta1.ILocationInfo[]|null); + + /** EntityAnnotation properties */ + properties?: (google.cloud.vision.v1p3beta1.IProperty[]|null); + } + + /** Represents an EntityAnnotation. */ + class EntityAnnotation implements IEntityAnnotation { + + /** + * Constructs a new EntityAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IEntityAnnotation); + + /** EntityAnnotation mid. */ + public mid: string; + + /** EntityAnnotation locale. */ + public locale: string; + + /** EntityAnnotation description. */ + public description: string; + + /** EntityAnnotation score. */ + public score: number; + + /** EntityAnnotation confidence. */ + public confidence: number; + + /** EntityAnnotation topicality. */ + public topicality: number; + + /** EntityAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** EntityAnnotation locations. */ + public locations: google.cloud.vision.v1p3beta1.ILocationInfo[]; + + /** EntityAnnotation properties. */ + public properties: google.cloud.vision.v1p3beta1.IProperty[]; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IEntityAnnotation): google.cloud.vision.v1p3beta1.EntityAnnotation; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.EntityAnnotation; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.EntityAnnotation; + + /** + * Verifies an EntityAnnotation message. + * @param message Plain 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 EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.EntityAnnotation; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @param message EntityAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.EntityAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LocalizedObjectAnnotation. */ + interface ILocalizedObjectAnnotation { + + /** LocalizedObjectAnnotation mid */ + mid?: (string|null); + + /** LocalizedObjectAnnotation languageCode */ + languageCode?: (string|null); + + /** LocalizedObjectAnnotation name */ + name?: (string|null); + + /** LocalizedObjectAnnotation score */ + score?: (number|null); + + /** LocalizedObjectAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + } + + /** Represents a LocalizedObjectAnnotation. */ + class LocalizedObjectAnnotation implements ILocalizedObjectAnnotation { + + /** + * Constructs a new LocalizedObjectAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation); + + /** LocalizedObjectAnnotation mid. */ + public mid: string; + + /** LocalizedObjectAnnotation languageCode. */ + public languageCode: string; + + /** LocalizedObjectAnnotation name. */ + public name: string; + + /** LocalizedObjectAnnotation score. */ + public score: number; + + /** LocalizedObjectAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** + * Creates a new LocalizedObjectAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalizedObjectAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation): google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation; + + /** + * Encodes the specified LocalizedObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @param message LocalizedObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalizedObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @param message LocalizedObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation; + + /** + * Verifies a LocalizedObjectAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalizedObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalizedObjectAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation; + + /** + * Creates a plain object from a LocalizedObjectAnnotation message. Also converts values to other types if specified. + * @param message LocalizedObjectAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalizedObjectAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SafeSearchAnnotation. */ + interface ISafeSearchAnnotation { + + /** SafeSearchAnnotation adult */ + adult?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** SafeSearchAnnotation spoof */ + spoof?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** SafeSearchAnnotation medical */ + medical?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** SafeSearchAnnotation violence */ + violence?: (google.cloud.vision.v1p3beta1.Likelihood|null); + + /** SafeSearchAnnotation racy */ + racy?: (google.cloud.vision.v1p3beta1.Likelihood|null); + } + + /** Represents a SafeSearchAnnotation. */ + class SafeSearchAnnotation implements ISafeSearchAnnotation { + + /** + * Constructs a new SafeSearchAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ISafeSearchAnnotation); + + /** SafeSearchAnnotation adult. */ + public adult: google.cloud.vision.v1p3beta1.Likelihood; + + /** SafeSearchAnnotation spoof. */ + public spoof: google.cloud.vision.v1p3beta1.Likelihood; + + /** SafeSearchAnnotation medical. */ + public medical: google.cloud.vision.v1p3beta1.Likelihood; + + /** SafeSearchAnnotation violence. */ + public violence: google.cloud.vision.v1p3beta1.Likelihood; + + /** SafeSearchAnnotation racy. */ + public racy: google.cloud.vision.v1p3beta1.Likelihood; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns SafeSearchAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ISafeSearchAnnotation): google.cloud.vision.v1p3beta1.SafeSearchAnnotation; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.SafeSearchAnnotation; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.SafeSearchAnnotation; + + /** + * Verifies a SafeSearchAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafeSearchAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.SafeSearchAnnotation; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @param message SafeSearchAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.SafeSearchAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LatLongRect. */ + interface ILatLongRect { + + /** LatLongRect minLatLng */ + minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng */ + maxLatLng?: (google.type.ILatLng|null); + } + + /** Represents a LatLongRect. */ + class LatLongRect implements ILatLongRect { + + /** + * Constructs a new LatLongRect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ILatLongRect); + + /** LatLongRect minLatLng. */ + public minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng. */ + public maxLatLng?: (google.type.ILatLng|null); + + /** + * Creates a new LatLongRect instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLongRect instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ILatLongRect): google.cloud.vision.v1p3beta1.LatLongRect; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p3beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.LatLongRect; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.LatLongRect; + + /** + * Verifies a LatLongRect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLongRect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.LatLongRect; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @param message LatLongRect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.LatLongRect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLongRect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo color */ + color?: (google.type.IColor|null); + + /** ColorInfo score */ + score?: (number|null); + + /** ColorInfo pixelFraction */ + pixelFraction?: (number|null); + } + + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { + + /** + * Constructs a new ColorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IColorInfo); + + /** ColorInfo color. */ + public color?: (google.type.IColor|null); + + /** ColorInfo score. */ + public score: number; + + /** ColorInfo pixelFraction. */ + public pixelFraction: number; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColorInfo instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IColorInfo): google.cloud.vision.v1p3beta1.ColorInfo; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ColorInfo; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ColorInfo; + + /** + * Verifies a ColorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ColorInfo; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DominantColorsAnnotation. */ + interface IDominantColorsAnnotation { + + /** DominantColorsAnnotation colors */ + colors?: (google.cloud.vision.v1p3beta1.IColorInfo[]|null); + } + + /** Represents a DominantColorsAnnotation. */ + class DominantColorsAnnotation implements IDominantColorsAnnotation { + + /** + * Constructs a new DominantColorsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IDominantColorsAnnotation); + + /** DominantColorsAnnotation colors. */ + public colors: google.cloud.vision.v1p3beta1.IColorInfo[]; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns DominantColorsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IDominantColorsAnnotation): google.cloud.vision.v1p3beta1.DominantColorsAnnotation; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.DominantColorsAnnotation; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.DominantColorsAnnotation; + + /** + * Verifies a DominantColorsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DominantColorsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.DominantColorsAnnotation; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @param message DominantColorsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.DominantColorsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageProperties. */ + interface IImageProperties { + + /** ImageProperties dominantColors */ + dominantColors?: (google.cloud.vision.v1p3beta1.IDominantColorsAnnotation|null); + } + + /** Represents an ImageProperties. */ + class ImageProperties implements IImageProperties { + + /** + * Constructs a new ImageProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImageProperties); + + /** ImageProperties dominantColors. */ + public dominantColors?: (google.cloud.vision.v1p3beta1.IDominantColorsAnnotation|null); + + /** + * Creates a new ImageProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageProperties instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImageProperties): google.cloud.vision.v1p3beta1.ImageProperties; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImageProperties; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImageProperties; + + /** + * Verifies an ImageProperties message. + * @param message Plain 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 ImageProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImageProperties; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @param message ImageProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImageProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHint. */ + interface ICropHint { + + /** CropHint boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** CropHint confidence */ + confidence?: (number|null); + + /** CropHint importanceFraction */ + importanceFraction?: (number|null); + } + + /** Represents a CropHint. */ + class CropHint implements ICropHint { + + /** + * Constructs a new CropHint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ICropHint); + + /** CropHint boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** CropHint confidence. */ + public confidence: number; + + /** CropHint importanceFraction. */ + public importanceFraction: number; + + /** + * Creates a new CropHint instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHint instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ICropHint): google.cloud.vision.v1p3beta1.CropHint; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.CropHint; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.CropHint; + + /** + * Verifies a CropHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.CropHint; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @param message CropHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.CropHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsAnnotation. */ + interface ICropHintsAnnotation { + + /** CropHintsAnnotation cropHints */ + cropHints?: (google.cloud.vision.v1p3beta1.ICropHint[]|null); + } + + /** Represents a CropHintsAnnotation. */ + class CropHintsAnnotation implements ICropHintsAnnotation { + + /** + * Constructs a new CropHintsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ICropHintsAnnotation); + + /** CropHintsAnnotation cropHints. */ + public cropHints: google.cloud.vision.v1p3beta1.ICropHint[]; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ICropHintsAnnotation): google.cloud.vision.v1p3beta1.CropHintsAnnotation; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.CropHintsAnnotation; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.CropHintsAnnotation; + + /** + * Verifies a CropHintsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.CropHintsAnnotation; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @param message CropHintsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.CropHintsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsParams. */ + interface ICropHintsParams { + + /** CropHintsParams aspectRatios */ + aspectRatios?: (number[]|null); + } + + /** Represents a CropHintsParams. */ + class CropHintsParams implements ICropHintsParams { + + /** + * Constructs a new CropHintsParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ICropHintsParams); + + /** CropHintsParams aspectRatios. */ + public aspectRatios: number[]; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsParams instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ICropHintsParams): google.cloud.vision.v1p3beta1.CropHintsParams; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.CropHintsParams; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.CropHintsParams; + + /** + * Verifies a CropHintsParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.CropHintsParams; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @param message CropHintsParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.CropHintsParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetectionParams. */ + interface IWebDetectionParams { + + /** WebDetectionParams includeGeoResults */ + includeGeoResults?: (boolean|null); + } + + /** Represents a WebDetectionParams. */ + class WebDetectionParams implements IWebDetectionParams { + + /** + * Constructs a new WebDetectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IWebDetectionParams); + + /** WebDetectionParams includeGeoResults. */ + public includeGeoResults: boolean; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetectionParams instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IWebDetectionParams): google.cloud.vision.v1p3beta1.WebDetectionParams; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.WebDetectionParams; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.WebDetectionParams; + + /** + * Verifies a WebDetectionParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.WebDetectionParams; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @param message WebDetectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.WebDetectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageContext. */ + interface IImageContext { + + /** ImageContext latLongRect */ + latLongRect?: (google.cloud.vision.v1p3beta1.ILatLongRect|null); + + /** ImageContext languageHints */ + languageHints?: (string[]|null); + + /** ImageContext cropHintsParams */ + cropHintsParams?: (google.cloud.vision.v1p3beta1.ICropHintsParams|null); + + /** ImageContext productSearchParams */ + productSearchParams?: (google.cloud.vision.v1p3beta1.IProductSearchParams|null); + + /** ImageContext webDetectionParams */ + webDetectionParams?: (google.cloud.vision.v1p3beta1.IWebDetectionParams|null); + } + + /** Represents an ImageContext. */ + class ImageContext implements IImageContext { + + /** + * Constructs a new ImageContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImageContext); + + /** ImageContext latLongRect. */ + public latLongRect?: (google.cloud.vision.v1p3beta1.ILatLongRect|null); + + /** ImageContext languageHints. */ + public languageHints: string[]; + + /** ImageContext cropHintsParams. */ + public cropHintsParams?: (google.cloud.vision.v1p3beta1.ICropHintsParams|null); + + /** ImageContext productSearchParams. */ + public productSearchParams?: (google.cloud.vision.v1p3beta1.IProductSearchParams|null); + + /** ImageContext webDetectionParams. */ + public webDetectionParams?: (google.cloud.vision.v1p3beta1.IWebDetectionParams|null); + + /** + * Creates a new ImageContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageContext instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImageContext): google.cloud.vision.v1p3beta1.ImageContext; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImageContext; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImageContext; + + /** + * Verifies an ImageContext message. + * @param message Plain 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 ImageContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImageContext; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @param message ImageContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImageContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageRequest. */ + interface IAnnotateImageRequest { + + /** AnnotateImageRequest image */ + image?: (google.cloud.vision.v1p3beta1.IImage|null); + + /** AnnotateImageRequest features */ + features?: (google.cloud.vision.v1p3beta1.IFeature[]|null); + + /** AnnotateImageRequest imageContext */ + imageContext?: (google.cloud.vision.v1p3beta1.IImageContext|null); + } + + /** Represents an AnnotateImageRequest. */ + class AnnotateImageRequest implements IAnnotateImageRequest { + + /** + * Constructs a new AnnotateImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAnnotateImageRequest); + + /** AnnotateImageRequest image. */ + public image?: (google.cloud.vision.v1p3beta1.IImage|null); + + /** AnnotateImageRequest features. */ + public features: google.cloud.vision.v1p3beta1.IFeature[]; + + /** AnnotateImageRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p3beta1.IImageContext|null); + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAnnotateImageRequest): google.cloud.vision.v1p3beta1.AnnotateImageRequest; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AnnotateImageRequest; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AnnotateImageRequest; + + /** + * Verifies an AnnotateImageRequest message. + * @param message Plain 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 AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AnnotateImageRequest; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @param message AnnotateImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AnnotateImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageAnnotationContext. */ + interface IImageAnnotationContext { + + /** ImageAnnotationContext uri */ + uri?: (string|null); + + /** ImageAnnotationContext pageNumber */ + pageNumber?: (number|null); + } + + /** Represents an ImageAnnotationContext. */ + class ImageAnnotationContext implements IImageAnnotationContext { + + /** + * Constructs a new ImageAnnotationContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImageAnnotationContext); + + /** ImageAnnotationContext uri. */ + public uri: string; + + /** ImageAnnotationContext pageNumber. */ + public pageNumber: number; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageAnnotationContext instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImageAnnotationContext): google.cloud.vision.v1p3beta1.ImageAnnotationContext; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImageAnnotationContext; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImageAnnotationContext; + + /** + * Verifies an ImageAnnotationContext message. + * @param message Plain 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 ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageAnnotationContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImageAnnotationContext; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @param message ImageAnnotationContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImageAnnotationContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageResponse. */ + interface IAnnotateImageResponse { + + /** AnnotateImageResponse faceAnnotations */ + faceAnnotations?: (google.cloud.vision.v1p3beta1.IFaceAnnotation[]|null); + + /** AnnotateImageResponse landmarkAnnotations */ + landmarkAnnotations?: (google.cloud.vision.v1p3beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse logoAnnotations */ + logoAnnotations?: (google.cloud.vision.v1p3beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse labelAnnotations */ + labelAnnotations?: (google.cloud.vision.v1p3beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse localizedObjectAnnotations */ + localizedObjectAnnotations?: (google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation[]|null); + + /** AnnotateImageResponse textAnnotations */ + textAnnotations?: (google.cloud.vision.v1p3beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse fullTextAnnotation */ + fullTextAnnotation?: (google.cloud.vision.v1p3beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation */ + safeSearchAnnotation?: (google.cloud.vision.v1p3beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation */ + imagePropertiesAnnotation?: (google.cloud.vision.v1p3beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation */ + cropHintsAnnotation?: (google.cloud.vision.v1p3beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection */ + webDetection?: (google.cloud.vision.v1p3beta1.IWebDetection|null); + + /** AnnotateImageResponse productSearchResults */ + productSearchResults?: (google.cloud.vision.v1p3beta1.IProductSearchResults|null); + + /** AnnotateImageResponse error */ + error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context */ + context?: (google.cloud.vision.v1p3beta1.IImageAnnotationContext|null); + } + + /** Represents an AnnotateImageResponse. */ + class AnnotateImageResponse implements IAnnotateImageResponse { + + /** + * Constructs a new AnnotateImageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAnnotateImageResponse); + + /** AnnotateImageResponse faceAnnotations. */ + public faceAnnotations: google.cloud.vision.v1p3beta1.IFaceAnnotation[]; + + /** AnnotateImageResponse landmarkAnnotations. */ + public landmarkAnnotations: google.cloud.vision.v1p3beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse logoAnnotations. */ + public logoAnnotations: google.cloud.vision.v1p3beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse labelAnnotations. */ + public labelAnnotations: google.cloud.vision.v1p3beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse localizedObjectAnnotations. */ + public localizedObjectAnnotations: google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation[]; + + /** AnnotateImageResponse textAnnotations. */ + public textAnnotations: google.cloud.vision.v1p3beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse fullTextAnnotation. */ + public fullTextAnnotation?: (google.cloud.vision.v1p3beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation. */ + public safeSearchAnnotation?: (google.cloud.vision.v1p3beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation. */ + public imagePropertiesAnnotation?: (google.cloud.vision.v1p3beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation. */ + public cropHintsAnnotation?: (google.cloud.vision.v1p3beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection. */ + public webDetection?: (google.cloud.vision.v1p3beta1.IWebDetection|null); + + /** AnnotateImageResponse productSearchResults. */ + public productSearchResults?: (google.cloud.vision.v1p3beta1.IProductSearchResults|null); + + /** AnnotateImageResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context. */ + public context?: (google.cloud.vision.v1p3beta1.IImageAnnotationContext|null); + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAnnotateImageResponse): google.cloud.vision.v1p3beta1.AnnotateImageResponse; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AnnotateImageResponse; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AnnotateImageResponse; + + /** + * Verifies an AnnotateImageResponse message. + * @param message Plain 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 AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AnnotateImageResponse; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @param message AnnotateImageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AnnotateImageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateFileResponse. */ + interface IAnnotateFileResponse { + + /** AnnotateFileResponse inputConfig */ + inputConfig?: (google.cloud.vision.v1p3beta1.IInputConfig|null); + + /** AnnotateFileResponse responses */ + responses?: (google.cloud.vision.v1p3beta1.IAnnotateImageResponse[]|null); + } + + /** Represents an AnnotateFileResponse. */ + class AnnotateFileResponse implements IAnnotateFileResponse { + + /** + * Constructs a new AnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAnnotateFileResponse); + + /** AnnotateFileResponse inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p3beta1.IInputConfig|null); + + /** AnnotateFileResponse responses. */ + public responses: google.cloud.vision.v1p3beta1.IAnnotateImageResponse[]; + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAnnotateFileResponse): google.cloud.vision.v1p3beta1.AnnotateFileResponse; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AnnotateFileResponse; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AnnotateFileResponse; + + /** + * Verifies an AnnotateFileResponse message. + * @param message Plain 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 AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AnnotateFileResponse; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @param message AnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesRequest. */ + interface IBatchAnnotateImagesRequest { + + /** BatchAnnotateImagesRequest requests */ + requests?: (google.cloud.vision.v1p3beta1.IAnnotateImageRequest[]|null); + } + + /** Represents a BatchAnnotateImagesRequest. */ + class BatchAnnotateImagesRequest implements IBatchAnnotateImagesRequest { + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest); + + /** BatchAnnotateImagesRequest requests. */ + public requests: google.cloud.vision.v1p3beta1.IAnnotateImageRequest[]; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest): google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesResponse. */ + interface IBatchAnnotateImagesResponse { + + /** BatchAnnotateImagesResponse responses */ + responses?: (google.cloud.vision.v1p3beta1.IAnnotateImageResponse[]|null); + } + + /** Represents a BatchAnnotateImagesResponse. */ + class BatchAnnotateImagesResponse implements IBatchAnnotateImagesResponse { + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse); + + /** BatchAnnotateImagesResponse responses. */ + public responses: google.cloud.vision.v1p3beta1.IAnnotateImageResponse[]; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse): google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileRequest. */ + interface IAsyncAnnotateFileRequest { + + /** AsyncAnnotateFileRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1p3beta1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features */ + features?: (google.cloud.vision.v1p3beta1.IFeature[]|null); + + /** AsyncAnnotateFileRequest imageContext */ + imageContext?: (google.cloud.vision.v1p3beta1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig */ + outputConfig?: (google.cloud.vision.v1p3beta1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileRequest. */ + class AsyncAnnotateFileRequest implements IAsyncAnnotateFileRequest { + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest); + + /** AsyncAnnotateFileRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p3beta1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features. */ + public features: google.cloud.vision.v1p3beta1.IFeature[]; + + /** AsyncAnnotateFileRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p3beta1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p3beta1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest): google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @param message Plain 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 AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileResponse. */ + interface IAsyncAnnotateFileResponse { + + /** AsyncAnnotateFileResponse outputConfig */ + outputConfig?: (google.cloud.vision.v1p3beta1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileResponse. */ + class AsyncAnnotateFileResponse implements IAsyncAnnotateFileResponse { + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse); + + /** AsyncAnnotateFileResponse outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p3beta1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse): google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @param message Plain 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 AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesRequest. */ + interface IAsyncBatchAnnotateFilesRequest { + + /** AsyncBatchAnnotateFilesRequest requests */ + requests?: (google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest[]|null); + } + + /** Represents an AsyncBatchAnnotateFilesRequest. */ + class AsyncBatchAnnotateFilesRequest implements IAsyncBatchAnnotateFilesRequest { + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest); + + /** AsyncBatchAnnotateFilesRequest requests. */ + public requests: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest[]; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @param message Plain 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 AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesResponse. */ + interface IAsyncBatchAnnotateFilesResponse { + + /** AsyncBatchAnnotateFilesResponse responses */ + responses?: (google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse[]|null); + } + + /** Represents an AsyncBatchAnnotateFilesResponse. */ + class AsyncBatchAnnotateFilesResponse implements IAsyncBatchAnnotateFilesResponse { + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse); + + /** AsyncBatchAnnotateFilesResponse responses. */ + public responses: google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse[]; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @param message Plain 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 AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.vision.v1p3beta1.IGcsSource|null); + + /** InputConfig mimeType */ + mimeType?: (string|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.vision.v1p3beta1.IGcsSource|null); + + /** InputConfig mimeType. */ + public mimeType: string; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IInputConfig): google.cloud.vision.v1p3beta1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.vision.v1p3beta1.IGcsDestination|null); + + /** OutputConfig batchSize */ + batchSize?: (number|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.vision.v1p3beta1.IGcsDestination|null); + + /** OutputConfig batchSize. */ + public batchSize: number; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IOutputConfig): google.cloud.vision.v1p3beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource uri */ + uri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IGcsSource); + + /** GcsSource uri. */ + public uri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IGcsSource): google.cloud.vision.v1p3beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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 uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IGcsDestination): google.cloud.vision.v1p3beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Likelihood enum. */ + enum Likelihood { + UNKNOWN = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata state */ + state?: (google.cloud.vision.v1p3beta1.OperationMetadata.State|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 OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IOperationMetadata); + + /** OperationMetadata state. */ + public state: google.cloud.vision.v1p3beta1.OperationMetadata.State; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IOperationMetadata): google.cloud.vision.v1p3beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p3beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATED = 1, + RUNNING = 2, + DONE = 3, + CANCELLED = 4 + } + } + + /** Properties of a Vertex. */ + interface IVertex { + + /** Vertex x */ + x?: (number|null); + + /** Vertex y */ + y?: (number|null); + } + + /** Represents a Vertex. */ + class Vertex implements IVertex { + + /** + * Constructs a new Vertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IVertex); + + /** Vertex x. */ + public x: number; + + /** Vertex y. */ + public y: number; + + /** + * Creates a new Vertex instance using the specified properties. + * @param [properties] Properties to set + * @returns Vertex instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IVertex): google.cloud.vision.v1p3beta1.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Vertex; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Vertex; + + /** + * Verifies a Vertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Vertex; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @param message Vertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vertex 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.vision.v1p3beta1.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.vision.v1p3beta1.INormalizedVertex): google.cloud.vision.v1p3beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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 vertices */ + vertices?: (google.cloud.vision.v1p3beta1.IVertex[]|null); + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.vision.v1p3beta1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.vision.v1p3beta1.IVertex[]; + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.vision.v1p3beta1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IBoundingPoly): google.cloud.vision.v1p3beta1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NormalizedBoundingPoly. */ + interface INormalizedBoundingPoly { + + /** NormalizedBoundingPoly vertices */ + vertices?: (google.cloud.vision.v1p3beta1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedBoundingPoly. */ + class NormalizedBoundingPoly implements INormalizedBoundingPoly { + + /** + * Constructs a new NormalizedBoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.INormalizedBoundingPoly); + + /** NormalizedBoundingPoly vertices. */ + public vertices: google.cloud.vision.v1p3beta1.INormalizedVertex[]; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingPoly instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.INormalizedBoundingPoly): google.cloud.vision.v1p3beta1.NormalizedBoundingPoly; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.NormalizedBoundingPoly; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.NormalizedBoundingPoly; + + /** + * Verifies a NormalizedBoundingPoly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.NormalizedBoundingPoly; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @param message NormalizedBoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.NormalizedBoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Position. */ + interface IPosition { + + /** Position x */ + x?: (number|null); + + /** Position y */ + y?: (number|null); + + /** Position z */ + z?: (number|null); + } + + /** Represents a Position. */ + class Position implements IPosition { + + /** + * Constructs a new Position. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IPosition); + + /** Position x. */ + public x: number; + + /** Position y. */ + public y: number; + + /** Position z. */ + public z: number; + + /** + * Creates a new Position instance using the specified properties. + * @param [properties] Properties to set + * @returns Position instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IPosition): google.cloud.vision.v1p3beta1.Position; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Position message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Position; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Position; + + /** + * Verifies a Position message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Position + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Position; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @param message Position + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Position, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Position to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProductSearchParams. */ + interface IProductSearchParams { + + /** ProductSearchParams catalogName */ + catalogName?: (string|null); + + /** ProductSearchParams category */ + category?: (google.cloud.vision.v1p3beta1.ProductSearchCategory|null); + + /** ProductSearchParams productCategory */ + productCategory?: (string|null); + + /** ProductSearchParams normalizedBoundingPoly */ + normalizedBoundingPoly?: (google.cloud.vision.v1p3beta1.INormalizedBoundingPoly|null); + + /** ProductSearchParams boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** ProductSearchParams view */ + view?: (google.cloud.vision.v1p3beta1.ProductSearchResultsView|null); + + /** ProductSearchParams productSet */ + productSet?: (string|null); + + /** ProductSearchParams productCategories */ + productCategories?: (string[]|null); + + /** ProductSearchParams filter */ + filter?: (string|null); + } + + /** Represents a ProductSearchParams. */ + class ProductSearchParams implements IProductSearchParams { + + /** + * Constructs a new ProductSearchParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IProductSearchParams); + + /** ProductSearchParams catalogName. */ + public catalogName: string; + + /** ProductSearchParams category. */ + public category: google.cloud.vision.v1p3beta1.ProductSearchCategory; + + /** ProductSearchParams productCategory. */ + public productCategory: string; + + /** ProductSearchParams normalizedBoundingPoly. */ + public normalizedBoundingPoly?: (google.cloud.vision.v1p3beta1.INormalizedBoundingPoly|null); + + /** ProductSearchParams boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** ProductSearchParams view. */ + public view: google.cloud.vision.v1p3beta1.ProductSearchResultsView; + + /** ProductSearchParams productSet. */ + public productSet: string; + + /** ProductSearchParams productCategories. */ + public productCategories: string[]; + + /** ProductSearchParams filter. */ + public filter: string; + + /** + * Creates a new ProductSearchParams instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSearchParams instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IProductSearchParams): google.cloud.vision.v1p3beta1.ProductSearchParams; + + /** + * Encodes the specified ProductSearchParams message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchParams.verify|verify} messages. + * @param message ProductSearchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IProductSearchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSearchParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchParams.verify|verify} messages. + * @param message ProductSearchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IProductSearchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ProductSearchParams; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ProductSearchParams; + + /** + * Verifies a ProductSearchParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSearchParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSearchParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ProductSearchParams; + + /** + * Creates a plain object from a ProductSearchParams message. Also converts values to other types if specified. + * @param message ProductSearchParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ProductSearchParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSearchParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProductSearchResults. */ + interface IProductSearchResults { + + /** ProductSearchResults category */ + category?: (google.cloud.vision.v1p3beta1.ProductSearchCategory|null); + + /** ProductSearchResults productCategory */ + productCategory?: (string|null); + + /** ProductSearchResults indexTime */ + indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSearchResults products */ + products?: (google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo[]|null); + + /** ProductSearchResults results */ + results?: (google.cloud.vision.v1p3beta1.ProductSearchResults.IResult[]|null); + } + + /** Represents a ProductSearchResults. */ + class ProductSearchResults implements IProductSearchResults { + + /** + * Constructs a new ProductSearchResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IProductSearchResults); + + /** ProductSearchResults category. */ + public category: google.cloud.vision.v1p3beta1.ProductSearchCategory; + + /** ProductSearchResults productCategory. */ + public productCategory: string; + + /** ProductSearchResults indexTime. */ + public indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSearchResults products. */ + public products: google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo[]; + + /** ProductSearchResults results. */ + public results: google.cloud.vision.v1p3beta1.ProductSearchResults.IResult[]; + + /** + * Creates a new ProductSearchResults instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSearchResults instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IProductSearchResults): google.cloud.vision.v1p3beta1.ProductSearchResults; + + /** + * Encodes the specified ProductSearchResults message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.verify|verify} messages. + * @param message ProductSearchResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IProductSearchResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSearchResults message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.verify|verify} messages. + * @param message ProductSearchResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IProductSearchResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ProductSearchResults; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ProductSearchResults; + + /** + * Verifies a ProductSearchResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSearchResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSearchResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ProductSearchResults; + + /** + * Creates a plain object from a ProductSearchResults message. Also converts values to other types if specified. + * @param message ProductSearchResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ProductSearchResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSearchResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ProductSearchResults { + + /** Properties of a ProductInfo. */ + interface IProductInfo { + + /** ProductInfo productId */ + productId?: (string|null); + + /** ProductInfo imageUri */ + imageUri?: (string|null); + + /** ProductInfo score */ + score?: (number|null); + } + + /** Represents a ProductInfo. */ + class ProductInfo implements IProductInfo { + + /** + * Constructs a new ProductInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo); + + /** ProductInfo productId. */ + public productId: string; + + /** ProductInfo imageUri. */ + public imageUri: string; + + /** ProductInfo score. */ + public score: number; + + /** + * Creates a new ProductInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductInfo instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo): google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo; + + /** + * Encodes the specified ProductInfo message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.verify|verify} messages. + * @param message ProductInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.verify|verify} messages. + * @param message ProductInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo; + + /** + * Decodes a ProductInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo; + + /** + * Verifies a ProductInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo; + + /** + * Creates a plain object from a ProductInfo message. Also converts values to other types if specified. + * @param message ProductInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Result. */ + interface IResult { + + /** Result product */ + product?: (google.cloud.vision.v1p3beta1.IProduct|null); + + /** Result score */ + score?: (number|null); + + /** Result image */ + image?: (string|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ProductSearchResults.IResult); + + /** Result product. */ + public product?: (google.cloud.vision.v1p3beta1.IProduct|null); + + /** Result score. */ + public score: number; + + /** Result image. */ + public image: string; + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ProductSearchResults.IResult): google.cloud.vision.v1p3beta1.ProductSearchResults.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ProductSearchResults.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ProductSearchResults.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ProductSearchResults.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ProductSearchResults.Result; + + /** + * Verifies a Result message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ProductSearchResults.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ProductSearchResults.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** ProductSearchCategory enum. */ + enum ProductSearchCategory { + PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0, + SHOES = 1, + BAGS = 2 + } + + /** ProductSearchResultsView enum. */ + enum ProductSearchResultsView { + BASIC = 0, + FULL = 1 + } + + /** Represents a ProductSearch */ + class ProductSearch extends $protobuf.rpc.Service { + + /** + * Constructs a new ProductSearch 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 ProductSearch 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): ProductSearch; + + /** + * Calls CreateProductSet. + * @param request CreateProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public createProductSet(request: google.cloud.vision.v1p3beta1.ICreateProductSetRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.CreateProductSetCallback): void; + + /** + * Calls CreateProductSet. + * @param request CreateProductSetRequest message or plain object + * @returns Promise + */ + public createProductSet(request: google.cloud.vision.v1p3beta1.ICreateProductSetRequest): Promise; + + /** + * Calls ListProductSets. + * @param request ListProductSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductSetsResponse + */ + public listProductSets(request: google.cloud.vision.v1p3beta1.IListProductSetsRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.ListProductSetsCallback): void; + + /** + * Calls ListProductSets. + * @param request ListProductSetsRequest message or plain object + * @returns Promise + */ + public listProductSets(request: google.cloud.vision.v1p3beta1.IListProductSetsRequest): Promise; + + /** + * Calls GetProductSet. + * @param request GetProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public getProductSet(request: google.cloud.vision.v1p3beta1.IGetProductSetRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.GetProductSetCallback): void; + + /** + * Calls GetProductSet. + * @param request GetProductSetRequest message or plain object + * @returns Promise + */ + public getProductSet(request: google.cloud.vision.v1p3beta1.IGetProductSetRequest): Promise; + + /** + * Calls UpdateProductSet. + * @param request UpdateProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public updateProductSet(request: google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.UpdateProductSetCallback): void; + + /** + * Calls UpdateProductSet. + * @param request UpdateProductSetRequest message or plain object + * @returns Promise + */ + public updateProductSet(request: google.cloud.vision.v1p3beta1.IUpdateProductSetRequest): Promise; + + /** + * Calls DeleteProductSet. + * @param request DeleteProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteProductSet(request: google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.DeleteProductSetCallback): void; + + /** + * Calls DeleteProductSet. + * @param request DeleteProductSetRequest message or plain object + * @returns Promise + */ + public deleteProductSet(request: google.cloud.vision.v1p3beta1.IDeleteProductSetRequest): Promise; + + /** + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public createProduct(request: google.cloud.vision.v1p3beta1.ICreateProductRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.CreateProductCallback): void; + + /** + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @returns Promise + */ + public createProduct(request: google.cloud.vision.v1p3beta1.ICreateProductRequest): Promise; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsResponse + */ + public listProducts(request: google.cloud.vision.v1p3beta1.IListProductsRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.ListProductsCallback): void; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @returns Promise + */ + public listProducts(request: google.cloud.vision.v1p3beta1.IListProductsRequest): Promise; + + /** + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public getProduct(request: google.cloud.vision.v1p3beta1.IGetProductRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.GetProductCallback): void; + + /** + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @returns Promise + */ + public getProduct(request: google.cloud.vision.v1p3beta1.IGetProductRequest): Promise; + + /** + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public updateProduct(request: google.cloud.vision.v1p3beta1.IUpdateProductRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.UpdateProductCallback): void; + + /** + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @returns Promise + */ + public updateProduct(request: google.cloud.vision.v1p3beta1.IUpdateProductRequest): Promise; + + /** + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteProduct(request: google.cloud.vision.v1p3beta1.IDeleteProductRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.DeleteProductCallback): void; + + /** + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @returns Promise + */ + public deleteProduct(request: google.cloud.vision.v1p3beta1.IDeleteProductRequest): Promise; + + /** + * Calls CreateReferenceImage. + * @param request CreateReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReferenceImage + */ + public createReferenceImage(request: google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.CreateReferenceImageCallback): void; + + /** + * Calls CreateReferenceImage. + * @param request CreateReferenceImageRequest message or plain object + * @returns Promise + */ + public createReferenceImage(request: google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest): Promise; + + /** + * Calls DeleteReferenceImage. + * @param request DeleteReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteReferenceImage(request: google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.DeleteReferenceImageCallback): void; + + /** + * Calls DeleteReferenceImage. + * @param request DeleteReferenceImageRequest message or plain object + * @returns Promise + */ + public deleteReferenceImage(request: google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest): Promise; + + /** + * Calls ListReferenceImages. + * @param request ListReferenceImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReferenceImagesResponse + */ + public listReferenceImages(request: google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.ListReferenceImagesCallback): void; + + /** + * Calls ListReferenceImages. + * @param request ListReferenceImagesRequest message or plain object + * @returns Promise + */ + public listReferenceImages(request: google.cloud.vision.v1p3beta1.IListReferenceImagesRequest): Promise; + + /** + * Calls GetReferenceImage. + * @param request GetReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReferenceImage + */ + public getReferenceImage(request: google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.GetReferenceImageCallback): void; + + /** + * Calls GetReferenceImage. + * @param request GetReferenceImageRequest message or plain object + * @returns Promise + */ + public getReferenceImage(request: google.cloud.vision.v1p3beta1.IGetReferenceImageRequest): Promise; + + /** + * Calls AddProductToProductSet. + * @param request AddProductToProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public addProductToProductSet(request: google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.AddProductToProductSetCallback): void; + + /** + * Calls AddProductToProductSet. + * @param request AddProductToProductSetRequest message or plain object + * @returns Promise + */ + public addProductToProductSet(request: google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest): Promise; + + /** + * Calls RemoveProductFromProductSet. + * @param request RemoveProductFromProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public removeProductFromProductSet(request: google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.RemoveProductFromProductSetCallback): void; + + /** + * Calls RemoveProductFromProductSet. + * @param request RemoveProductFromProductSetRequest message or plain object + * @returns Promise + */ + public removeProductFromProductSet(request: google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest): Promise; + + /** + * Calls ListProductsInProductSet. + * @param request ListProductsInProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsInProductSetResponse + */ + public listProductsInProductSet(request: google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.ListProductsInProductSetCallback): void; + + /** + * Calls ListProductsInProductSet. + * @param request ListProductsInProductSetRequest message or plain object + * @returns Promise + */ + public listProductsInProductSet(request: google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest): Promise; + + /** + * Calls ImportProductSets. + * @param request ImportProductSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importProductSets(request: google.cloud.vision.v1p3beta1.IImportProductSetsRequest, callback: google.cloud.vision.v1p3beta1.ProductSearch.ImportProductSetsCallback): void; + + /** + * Calls ImportProductSets. + * @param request ImportProductSetsRequest message or plain object + * @returns Promise + */ + public importProductSets(request: google.cloud.vision.v1p3beta1.IImportProductSetsRequest): Promise; + } + + namespace ProductSearch { + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#createProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type CreateProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listProductSets}. + * @param error Error, if any + * @param [response] ListProductSetsResponse + */ + type ListProductSetsCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ListProductSetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#getProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type GetProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#updateProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type UpdateProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#deleteProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#createProduct}. + * @param error Error, if any + * @param [response] Product + */ + type CreateProductCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listProducts}. + * @param error Error, if any + * @param [response] ListProductsResponse + */ + type ListProductsCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ListProductsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#getProduct}. + * @param error Error, if any + * @param [response] Product + */ + type GetProductCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#updateProduct}. + * @param error Error, if any + * @param [response] Product + */ + type UpdateProductCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#deleteProduct}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#createReferenceImage}. + * @param error Error, if any + * @param [response] ReferenceImage + */ + type CreateReferenceImageCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ReferenceImage) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#deleteReferenceImage}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteReferenceImageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listReferenceImages}. + * @param error Error, if any + * @param [response] ListReferenceImagesResponse + */ + type ListReferenceImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#getReferenceImage}. + * @param error Error, if any + * @param [response] ReferenceImage + */ + type GetReferenceImageCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ReferenceImage) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#addProductToProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type AddProductToProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#removeProductFromProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type RemoveProductFromProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listProductsInProductSet}. + * @param error Error, if any + * @param [response] ListProductsInProductSetResponse + */ + type ListProductsInProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#importProductSets}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportProductSetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Product. */ + interface IProduct { + + /** Product name */ + name?: (string|null); + + /** Product displayName */ + displayName?: (string|null); + + /** Product description */ + description?: (string|null); + + /** Product productCategory */ + productCategory?: (string|null); + + /** Product productLabels */ + productLabels?: (google.cloud.vision.v1p3beta1.Product.IKeyValue[]|null); + } + + /** Represents a Product. */ + class Product implements IProduct { + + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IProduct); + + /** Product name. */ + public name: string; + + /** Product displayName. */ + public displayName: string; + + /** Product description. */ + public description: string; + + /** Product productCategory. */ + public productCategory: string; + + /** Product productLabels. */ + public productLabels: google.cloud.vision.v1p3beta1.Product.IKeyValue[]; + + /** + * Creates a new Product instance using the specified properties. + * @param [properties] Properties to set + * @returns Product instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IProduct): google.cloud.vision.v1p3beta1.Product; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Product message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Product; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Product; + + /** + * Verifies a Product message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Product + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Product; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Product to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Product { + + /** Properties of a KeyValue. */ + interface IKeyValue { + + /** KeyValue key */ + key?: (string|null); + + /** KeyValue value */ + value?: (string|null); + } + + /** Represents a KeyValue. */ + class KeyValue implements IKeyValue { + + /** + * Constructs a new KeyValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.Product.IKeyValue); + + /** KeyValue key. */ + public key: string; + + /** KeyValue value. */ + public value: string; + + /** + * Creates a new KeyValue instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyValue instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.Product.IKeyValue): google.cloud.vision.v1p3beta1.Product.KeyValue; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.Product.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.Product.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Product.KeyValue; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Product.KeyValue; + + /** + * Verifies a KeyValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Product.KeyValue; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @param message KeyValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Product.KeyValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ProductSet. */ + interface IProductSet { + + /** ProductSet name */ + name?: (string|null); + + /** ProductSet displayName */ + displayName?: (string|null); + + /** ProductSet indexTime */ + indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSet indexError */ + indexError?: (google.rpc.IStatus|null); + } + + /** Represents a ProductSet. */ + class ProductSet implements IProductSet { + + /** + * Constructs a new ProductSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IProductSet); + + /** ProductSet name. */ + public name: string; + + /** ProductSet displayName. */ + public displayName: string; + + /** ProductSet indexTime. */ + public indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSet indexError. */ + public indexError?: (google.rpc.IStatus|null); + + /** + * Creates a new ProductSet instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSet instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IProductSet): google.cloud.vision.v1p3beta1.ProductSet; + + /** + * Encodes the specified ProductSet message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSet.verify|verify} messages. + * @param message ProductSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IProductSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSet message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSet.verify|verify} messages. + * @param message ProductSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IProductSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ProductSet; + + /** + * Decodes a ProductSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ProductSet; + + /** + * Verifies a ProductSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ProductSet; + + /** + * Creates a plain object from a ProductSet message. Also converts values to other types if specified. + * @param message ProductSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ProductSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReferenceImage. */ + interface IReferenceImage { + + /** ReferenceImage name */ + name?: (string|null); + + /** ReferenceImage uri */ + uri?: (string|null); + + /** ReferenceImage boundingPolys */ + boundingPolys?: (google.cloud.vision.v1p3beta1.IBoundingPoly[]|null); + } + + /** Represents a ReferenceImage. */ + class ReferenceImage implements IReferenceImage { + + /** + * Constructs a new ReferenceImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IReferenceImage); + + /** ReferenceImage name. */ + public name: string; + + /** ReferenceImage uri. */ + public uri: string; + + /** ReferenceImage boundingPolys. */ + public boundingPolys: google.cloud.vision.v1p3beta1.IBoundingPoly[]; + + /** + * Creates a new ReferenceImage instance using the specified properties. + * @param [properties] Properties to set + * @returns ReferenceImage instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IReferenceImage): google.cloud.vision.v1p3beta1.ReferenceImage; + + /** + * Encodes the specified ReferenceImage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ReferenceImage.verify|verify} messages. + * @param message ReferenceImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IReferenceImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReferenceImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ReferenceImage.verify|verify} messages. + * @param message ReferenceImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IReferenceImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ReferenceImage; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ReferenceImage; + + /** + * Verifies a ReferenceImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReferenceImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReferenceImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ReferenceImage; + + /** + * Creates a plain object from a ReferenceImage message. Also converts values to other types if specified. + * @param message ReferenceImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ReferenceImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReferenceImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateProductRequest. */ + interface ICreateProductRequest { + + /** CreateProductRequest parent */ + parent?: (string|null); + + /** CreateProductRequest product */ + product?: (google.cloud.vision.v1p3beta1.IProduct|null); + + /** CreateProductRequest productId */ + productId?: (string|null); + } + + /** Represents a CreateProductRequest. */ + class CreateProductRequest implements ICreateProductRequest { + + /** + * Constructs a new CreateProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ICreateProductRequest); + + /** CreateProductRequest parent. */ + public parent: string; + + /** CreateProductRequest product. */ + public product?: (google.cloud.vision.v1p3beta1.IProduct|null); + + /** CreateProductRequest productId. */ + public productId: string; + + /** + * Creates a new CreateProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ICreateProductRequest): google.cloud.vision.v1p3beta1.CreateProductRequest; + + /** + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.CreateProductRequest; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.CreateProductRequest; + + /** + * Verifies a CreateProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.CreateProductRequest; + + /** + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @param message CreateProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsRequest. */ + interface IListProductsRequest { + + /** ListProductsRequest parent */ + parent?: (string|null); + + /** ListProductsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductsRequest. */ + class ListProductsRequest implements IListProductsRequest { + + /** + * Constructs a new ListProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListProductsRequest); + + /** ListProductsRequest parent. */ + public parent: string; + + /** ListProductsRequest pageSize. */ + public pageSize: number; + + /** ListProductsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListProductsRequest): google.cloud.vision.v1p3beta1.ListProductsRequest; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListProductsRequest; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListProductsRequest; + + /** + * Verifies a ListProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListProductsRequest; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @param message ListProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsResponse. */ + interface IListProductsResponse { + + /** ListProductsResponse products */ + products?: (google.cloud.vision.v1p3beta1.IProduct[]|null); + + /** ListProductsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsResponse. */ + class ListProductsResponse implements IListProductsResponse { + + /** + * Constructs a new ListProductsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListProductsResponse); + + /** ListProductsResponse products. */ + public products: google.cloud.vision.v1p3beta1.IProduct[]; + + /** ListProductsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListProductsResponse): google.cloud.vision.v1p3beta1.ListProductsResponse; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListProductsResponse; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListProductsResponse; + + /** + * Verifies a ListProductsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListProductsResponse; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @param message ListProductsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetProductRequest. */ + interface IGetProductRequest { + + /** GetProductRequest name */ + name?: (string|null); + } + + /** Represents a GetProductRequest. */ + class GetProductRequest implements IGetProductRequest { + + /** + * Constructs a new GetProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IGetProductRequest); + + /** GetProductRequest name. */ + public name: string; + + /** + * Creates a new GetProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IGetProductRequest): google.cloud.vision.v1p3beta1.GetProductRequest; + + /** + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.GetProductRequest; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.GetProductRequest; + + /** + * Verifies a GetProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.GetProductRequest; + + /** + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @param message GetProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateProductRequest. */ + interface IUpdateProductRequest { + + /** UpdateProductRequest product */ + product?: (google.cloud.vision.v1p3beta1.IProduct|null); + + /** UpdateProductRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProductRequest. */ + class UpdateProductRequest implements IUpdateProductRequest { + + /** + * Constructs a new UpdateProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IUpdateProductRequest); + + /** UpdateProductRequest product. */ + public product?: (google.cloud.vision.v1p3beta1.IProduct|null); + + /** UpdateProductRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IUpdateProductRequest): google.cloud.vision.v1p3beta1.UpdateProductRequest; + + /** + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.UpdateProductRequest; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.UpdateProductRequest; + + /** + * Verifies an UpdateProductRequest message. + * @param message Plain 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.UpdateProductRequest; + + /** + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @param message UpdateProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteProductRequest. */ + interface IDeleteProductRequest { + + /** DeleteProductRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProductRequest. */ + class DeleteProductRequest implements IDeleteProductRequest { + + /** + * Constructs a new DeleteProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IDeleteProductRequest); + + /** DeleteProductRequest name. */ + public name: string; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IDeleteProductRequest): google.cloud.vision.v1p3beta1.DeleteProductRequest; + + /** + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.DeleteProductRequest; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.DeleteProductRequest; + + /** + * Verifies a DeleteProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.DeleteProductRequest; + + /** + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @param message DeleteProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateProductSetRequest. */ + interface ICreateProductSetRequest { + + /** CreateProductSetRequest parent */ + parent?: (string|null); + + /** CreateProductSetRequest productSet */ + productSet?: (google.cloud.vision.v1p3beta1.IProductSet|null); + + /** CreateProductSetRequest productSetId */ + productSetId?: (string|null); + } + + /** Represents a CreateProductSetRequest. */ + class CreateProductSetRequest implements ICreateProductSetRequest { + + /** + * Constructs a new CreateProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ICreateProductSetRequest); + + /** CreateProductSetRequest parent. */ + public parent: string; + + /** CreateProductSetRequest productSet. */ + public productSet?: (google.cloud.vision.v1p3beta1.IProductSet|null); + + /** CreateProductSetRequest productSetId. */ + public productSetId: string; + + /** + * Creates a new CreateProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ICreateProductSetRequest): google.cloud.vision.v1p3beta1.CreateProductSetRequest; + + /** + * Encodes the specified CreateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductSetRequest.verify|verify} messages. + * @param message CreateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ICreateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductSetRequest.verify|verify} messages. + * @param message CreateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ICreateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.CreateProductSetRequest; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.CreateProductSetRequest; + + /** + * Verifies a CreateProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.CreateProductSetRequest; + + /** + * Creates a plain object from a CreateProductSetRequest message. Also converts values to other types if specified. + * @param message CreateProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.CreateProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductSetsRequest. */ + interface IListProductSetsRequest { + + /** ListProductSetsRequest parent */ + parent?: (string|null); + + /** ListProductSetsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductSetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductSetsRequest. */ + class ListProductSetsRequest implements IListProductSetsRequest { + + /** + * Constructs a new ListProductSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListProductSetsRequest); + + /** ListProductSetsRequest parent. */ + public parent: string; + + /** ListProductSetsRequest pageSize. */ + public pageSize: number; + + /** ListProductSetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductSetsRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListProductSetsRequest): google.cloud.vision.v1p3beta1.ListProductSetsRequest; + + /** + * Encodes the specified ListProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsRequest.verify|verify} messages. + * @param message ListProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsRequest.verify|verify} messages. + * @param message ListProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListProductSetsRequest; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListProductSetsRequest; + + /** + * Verifies a ListProductSetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListProductSetsRequest; + + /** + * Creates a plain object from a ListProductSetsRequest message. Also converts values to other types if specified. + * @param message ListProductSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListProductSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductSetsResponse. */ + interface IListProductSetsResponse { + + /** ListProductSetsResponse productSets */ + productSets?: (google.cloud.vision.v1p3beta1.IProductSet[]|null); + + /** ListProductSetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductSetsResponse. */ + class ListProductSetsResponse implements IListProductSetsResponse { + + /** + * Constructs a new ListProductSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListProductSetsResponse); + + /** ListProductSetsResponse productSets. */ + public productSets: google.cloud.vision.v1p3beta1.IProductSet[]; + + /** ListProductSetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductSetsResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListProductSetsResponse): google.cloud.vision.v1p3beta1.ListProductSetsResponse; + + /** + * Encodes the specified ListProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsResponse.verify|verify} messages. + * @param message ListProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsResponse.verify|verify} messages. + * @param message ListProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListProductSetsResponse; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListProductSetsResponse; + + /** + * Verifies a ListProductSetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListProductSetsResponse; + + /** + * Creates a plain object from a ListProductSetsResponse message. Also converts values to other types if specified. + * @param message ListProductSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListProductSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetProductSetRequest. */ + interface IGetProductSetRequest { + + /** GetProductSetRequest name */ + name?: (string|null); + } + + /** Represents a GetProductSetRequest. */ + class GetProductSetRequest implements IGetProductSetRequest { + + /** + * Constructs a new GetProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IGetProductSetRequest); + + /** GetProductSetRequest name. */ + public name: string; + + /** + * Creates a new GetProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IGetProductSetRequest): google.cloud.vision.v1p3beta1.GetProductSetRequest; + + /** + * Encodes the specified GetProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductSetRequest.verify|verify} messages. + * @param message GetProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IGetProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductSetRequest.verify|verify} messages. + * @param message GetProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IGetProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.GetProductSetRequest; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.GetProductSetRequest; + + /** + * Verifies a GetProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.GetProductSetRequest; + + /** + * Creates a plain object from a GetProductSetRequest message. Also converts values to other types if specified. + * @param message GetProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.GetProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateProductSetRequest. */ + interface IUpdateProductSetRequest { + + /** UpdateProductSetRequest productSet */ + productSet?: (google.cloud.vision.v1p3beta1.IProductSet|null); + + /** UpdateProductSetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProductSetRequest. */ + class UpdateProductSetRequest implements IUpdateProductSetRequest { + + /** + * Constructs a new UpdateProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IUpdateProductSetRequest); + + /** UpdateProductSetRequest productSet. */ + public productSet?: (google.cloud.vision.v1p3beta1.IProductSet|null); + + /** UpdateProductSetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IUpdateProductSetRequest): google.cloud.vision.v1p3beta1.UpdateProductSetRequest; + + /** + * Encodes the specified UpdateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductSetRequest.verify|verify} messages. + * @param message UpdateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductSetRequest.verify|verify} messages. + * @param message UpdateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IUpdateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.UpdateProductSetRequest; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.UpdateProductSetRequest; + + /** + * Verifies an UpdateProductSetRequest message. + * @param message Plain 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 UpdateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.UpdateProductSetRequest; + + /** + * Creates a plain object from an UpdateProductSetRequest message. Also converts values to other types if specified. + * @param message UpdateProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.UpdateProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteProductSetRequest. */ + interface IDeleteProductSetRequest { + + /** DeleteProductSetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProductSetRequest. */ + class DeleteProductSetRequest implements IDeleteProductSetRequest { + + /** + * Constructs a new DeleteProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IDeleteProductSetRequest); + + /** DeleteProductSetRequest name. */ + public name: string; + + /** + * Creates a new DeleteProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IDeleteProductSetRequest): google.cloud.vision.v1p3beta1.DeleteProductSetRequest; + + /** + * Encodes the specified DeleteProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductSetRequest.verify|verify} messages. + * @param message DeleteProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductSetRequest.verify|verify} messages. + * @param message DeleteProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IDeleteProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.DeleteProductSetRequest; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.DeleteProductSetRequest; + + /** + * Verifies a DeleteProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.DeleteProductSetRequest; + + /** + * Creates a plain object from a DeleteProductSetRequest message. Also converts values to other types if specified. + * @param message DeleteProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.DeleteProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateReferenceImageRequest. */ + interface ICreateReferenceImageRequest { + + /** CreateReferenceImageRequest parent */ + parent?: (string|null); + + /** CreateReferenceImageRequest referenceImage */ + referenceImage?: (google.cloud.vision.v1p3beta1.IReferenceImage|null); + + /** CreateReferenceImageRequest referenceImageId */ + referenceImageId?: (string|null); + } + + /** Represents a CreateReferenceImageRequest. */ + class CreateReferenceImageRequest implements ICreateReferenceImageRequest { + + /** + * Constructs a new CreateReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest); + + /** CreateReferenceImageRequest parent. */ + public parent: string; + + /** CreateReferenceImageRequest referenceImage. */ + public referenceImage?: (google.cloud.vision.v1p3beta1.IReferenceImage|null); + + /** CreateReferenceImageRequest referenceImageId. */ + public referenceImageId: string; + + /** + * Creates a new CreateReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest): google.cloud.vision.v1p3beta1.CreateReferenceImageRequest; + + /** + * Encodes the specified CreateReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.verify|verify} messages. + * @param message CreateReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.verify|verify} messages. + * @param message CreateReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.CreateReferenceImageRequest; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.CreateReferenceImageRequest; + + /** + * Verifies a CreateReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.CreateReferenceImageRequest; + + /** + * Creates a plain object from a CreateReferenceImageRequest message. Also converts values to other types if specified. + * @param message CreateReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.CreateReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReferenceImagesRequest. */ + interface IListReferenceImagesRequest { + + /** ListReferenceImagesRequest parent */ + parent?: (string|null); + + /** ListReferenceImagesRequest pageSize */ + pageSize?: (number|null); + + /** ListReferenceImagesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListReferenceImagesRequest. */ + class ListReferenceImagesRequest implements IListReferenceImagesRequest { + + /** + * Constructs a new ListReferenceImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListReferenceImagesRequest); + + /** ListReferenceImagesRequest parent. */ + public parent: string; + + /** ListReferenceImagesRequest pageSize. */ + public pageSize: number; + + /** ListReferenceImagesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListReferenceImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReferenceImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListReferenceImagesRequest): google.cloud.vision.v1p3beta1.ListReferenceImagesRequest; + + /** + * Encodes the specified ListReferenceImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.verify|verify} messages. + * @param message ListReferenceImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReferenceImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.verify|verify} messages. + * @param message ListReferenceImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListReferenceImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListReferenceImagesRequest; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListReferenceImagesRequest; + + /** + * Verifies a ListReferenceImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReferenceImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReferenceImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListReferenceImagesRequest; + + /** + * Creates a plain object from a ListReferenceImagesRequest message. Also converts values to other types if specified. + * @param message ListReferenceImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListReferenceImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReferenceImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReferenceImagesResponse. */ + interface IListReferenceImagesResponse { + + /** ListReferenceImagesResponse referenceImages */ + referenceImages?: (google.cloud.vision.v1p3beta1.IReferenceImage[]|null); + + /** ListReferenceImagesResponse pageSize */ + pageSize?: (number|null); + + /** ListReferenceImagesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReferenceImagesResponse. */ + class ListReferenceImagesResponse implements IListReferenceImagesResponse { + + /** + * Constructs a new ListReferenceImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListReferenceImagesResponse); + + /** ListReferenceImagesResponse referenceImages. */ + public referenceImages: google.cloud.vision.v1p3beta1.IReferenceImage[]; + + /** ListReferenceImagesResponse pageSize. */ + public pageSize: number; + + /** ListReferenceImagesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReferenceImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReferenceImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListReferenceImagesResponse): google.cloud.vision.v1p3beta1.ListReferenceImagesResponse; + + /** + * Encodes the specified ListReferenceImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.verify|verify} messages. + * @param message ListReferenceImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListReferenceImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReferenceImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.verify|verify} messages. + * @param message ListReferenceImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListReferenceImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListReferenceImagesResponse; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListReferenceImagesResponse; + + /** + * Verifies a ListReferenceImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReferenceImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReferenceImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListReferenceImagesResponse; + + /** + * Creates a plain object from a ListReferenceImagesResponse message. Also converts values to other types if specified. + * @param message ListReferenceImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListReferenceImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReferenceImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetReferenceImageRequest. */ + interface IGetReferenceImageRequest { + + /** GetReferenceImageRequest name */ + name?: (string|null); + } + + /** Represents a GetReferenceImageRequest. */ + class GetReferenceImageRequest implements IGetReferenceImageRequest { + + /** + * Constructs a new GetReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IGetReferenceImageRequest); + + /** GetReferenceImageRequest name. */ + public name: string; + + /** + * Creates a new GetReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IGetReferenceImageRequest): google.cloud.vision.v1p3beta1.GetReferenceImageRequest; + + /** + * Encodes the specified GetReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetReferenceImageRequest.verify|verify} messages. + * @param message GetReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetReferenceImageRequest.verify|verify} messages. + * @param message GetReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IGetReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.GetReferenceImageRequest; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.GetReferenceImageRequest; + + /** + * Verifies a GetReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.GetReferenceImageRequest; + + /** + * Creates a plain object from a GetReferenceImageRequest message. Also converts values to other types if specified. + * @param message GetReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.GetReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteReferenceImageRequest. */ + interface IDeleteReferenceImageRequest { + + /** DeleteReferenceImageRequest name */ + name?: (string|null); + } + + /** Represents a DeleteReferenceImageRequest. */ + class DeleteReferenceImageRequest implements IDeleteReferenceImageRequest { + + /** + * Constructs a new DeleteReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest); + + /** DeleteReferenceImageRequest name. */ + public name: string; + + /** + * Creates a new DeleteReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest): google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest; + + /** + * Encodes the specified DeleteReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @param message DeleteReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @param message DeleteReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest; + + /** + * Verifies a DeleteReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest; + + /** + * Creates a plain object from a DeleteReferenceImageRequest message. Also converts values to other types if specified. + * @param message DeleteReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddProductToProductSetRequest. */ + interface IAddProductToProductSetRequest { + + /** AddProductToProductSetRequest name */ + name?: (string|null); + + /** AddProductToProductSetRequest product */ + product?: (string|null); + } + + /** Represents an AddProductToProductSetRequest. */ + class AddProductToProductSetRequest implements IAddProductToProductSetRequest { + + /** + * Constructs a new AddProductToProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest); + + /** AddProductToProductSetRequest name. */ + public name: string; + + /** AddProductToProductSetRequest product. */ + public product: string; + + /** + * Creates a new AddProductToProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddProductToProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest): google.cloud.vision.v1p3beta1.AddProductToProductSetRequest; + + /** + * Encodes the specified AddProductToProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.verify|verify} messages. + * @param message AddProductToProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddProductToProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.verify|verify} messages. + * @param message AddProductToProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.AddProductToProductSetRequest; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.AddProductToProductSetRequest; + + /** + * Verifies an AddProductToProductSetRequest message. + * @param message Plain 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 AddProductToProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddProductToProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.AddProductToProductSetRequest; + + /** + * Creates a plain object from an AddProductToProductSetRequest message. Also converts values to other types if specified. + * @param message AddProductToProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.AddProductToProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddProductToProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveProductFromProductSetRequest. */ + interface IRemoveProductFromProductSetRequest { + + /** RemoveProductFromProductSetRequest name */ + name?: (string|null); + + /** RemoveProductFromProductSetRequest product */ + product?: (string|null); + } + + /** Represents a RemoveProductFromProductSetRequest. */ + class RemoveProductFromProductSetRequest implements IRemoveProductFromProductSetRequest { + + /** + * Constructs a new RemoveProductFromProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest); + + /** RemoveProductFromProductSetRequest name. */ + public name: string; + + /** RemoveProductFromProductSetRequest product. */ + public product: string; + + /** + * Creates a new RemoveProductFromProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveProductFromProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest): google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @param message RemoveProductFromProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @param message RemoveProductFromProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest; + + /** + * Verifies a RemoveProductFromProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveProductFromProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveProductFromProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest; + + /** + * Creates a plain object from a RemoveProductFromProductSetRequest message. Also converts values to other types if specified. + * @param message RemoveProductFromProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveProductFromProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsInProductSetRequest. */ + interface IListProductsInProductSetRequest { + + /** ListProductsInProductSetRequest name */ + name?: (string|null); + + /** ListProductsInProductSetRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsInProductSetRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductsInProductSetRequest. */ + class ListProductsInProductSetRequest implements IListProductsInProductSetRequest { + + /** + * Constructs a new ListProductsInProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest); + + /** ListProductsInProductSetRequest name. */ + public name: string; + + /** ListProductsInProductSetRequest pageSize. */ + public pageSize: number; + + /** ListProductsInProductSetRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductsInProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsInProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest): google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest; + + /** + * Encodes the specified ListProductsInProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @param message ListProductsInProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsInProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @param message ListProductsInProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest; + + /** + * Verifies a ListProductsInProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsInProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsInProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest; + + /** + * Creates a plain object from a ListProductsInProductSetRequest message. Also converts values to other types if specified. + * @param message ListProductsInProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsInProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsInProductSetResponse. */ + interface IListProductsInProductSetResponse { + + /** ListProductsInProductSetResponse products */ + products?: (google.cloud.vision.v1p3beta1.IProduct[]|null); + + /** ListProductsInProductSetResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsInProductSetResponse. */ + class ListProductsInProductSetResponse implements IListProductsInProductSetResponse { + + /** + * Constructs a new ListProductsInProductSetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse); + + /** ListProductsInProductSetResponse products. */ + public products: google.cloud.vision.v1p3beta1.IProduct[]; + + /** ListProductsInProductSetResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductsInProductSetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsInProductSetResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse): google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse; + + /** + * Encodes the specified ListProductsInProductSetResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @param message ListProductsInProductSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsInProductSetResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @param message ListProductsInProductSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse; + + /** + * Verifies a ListProductsInProductSetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsInProductSetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsInProductSetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse; + + /** + * Creates a plain object from a ListProductsInProductSetResponse message. Also converts values to other types if specified. + * @param message ListProductsInProductSetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsInProductSetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsGcsSource. */ + interface IImportProductSetsGcsSource { + + /** ImportProductSetsGcsSource csvFileUri */ + csvFileUri?: (string|null); + } + + /** Represents an ImportProductSetsGcsSource. */ + class ImportProductSetsGcsSource implements IImportProductSetsGcsSource { + + /** + * Constructs a new ImportProductSetsGcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource); + + /** ImportProductSetsGcsSource csvFileUri. */ + public csvFileUri: string; + + /** + * Creates a new ImportProductSetsGcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsGcsSource instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource): google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource; + + /** + * Encodes the specified ImportProductSetsGcsSource message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @param message ImportProductSetsGcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsGcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @param message ImportProductSetsGcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource; + + /** + * Verifies an ImportProductSetsGcsSource message. + * @param message Plain 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 ImportProductSetsGcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsGcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource; + + /** + * Creates a plain object from an ImportProductSetsGcsSource message. Also converts values to other types if specified. + * @param message ImportProductSetsGcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsGcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsInputConfig. */ + interface IImportProductSetsInputConfig { + + /** ImportProductSetsInputConfig gcsSource */ + gcsSource?: (google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource|null); + } + + /** Represents an ImportProductSetsInputConfig. */ + class ImportProductSetsInputConfig implements IImportProductSetsInputConfig { + + /** + * Constructs a new ImportProductSetsInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig); + + /** ImportProductSetsInputConfig gcsSource. */ + public gcsSource?: (google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource|null); + + /** ImportProductSetsInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new ImportProductSetsInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsInputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig): google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig; + + /** + * Encodes the specified ImportProductSetsInputConfig message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @param message ImportProductSetsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsInputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @param message ImportProductSetsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig; + + /** + * Verifies an ImportProductSetsInputConfig message. + * @param message Plain 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 ImportProductSetsInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig; + + /** + * Creates a plain object from an ImportProductSetsInputConfig message. Also converts values to other types if specified. + * @param message ImportProductSetsInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsRequest. */ + interface IImportProductSetsRequest { + + /** ImportProductSetsRequest parent */ + parent?: (string|null); + + /** ImportProductSetsRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig|null); + } + + /** Represents an ImportProductSetsRequest. */ + class ImportProductSetsRequest implements IImportProductSetsRequest { + + /** + * Constructs a new ImportProductSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsRequest); + + /** ImportProductSetsRequest parent. */ + public parent: string; + + /** ImportProductSetsRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig|null); + + /** + * Creates a new ImportProductSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsRequest instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsRequest): google.cloud.vision.v1p3beta1.ImportProductSetsRequest; + + /** + * Encodes the specified ImportProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsRequest.verify|verify} messages. + * @param message ImportProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImportProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsRequest.verify|verify} messages. + * @param message ImportProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImportProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImportProductSetsRequest; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImportProductSetsRequest; + + /** + * Verifies an ImportProductSetsRequest message. + * @param message Plain 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 ImportProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImportProductSetsRequest; + + /** + * Creates a plain object from an ImportProductSetsRequest message. Also converts values to other types if specified. + * @param message ImportProductSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImportProductSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsResponse. */ + interface IImportProductSetsResponse { + + /** ImportProductSetsResponse referenceImages */ + referenceImages?: (google.cloud.vision.v1p3beta1.IReferenceImage[]|null); + + /** ImportProductSetsResponse statuses */ + statuses?: (google.rpc.IStatus[]|null); + } + + /** Represents an ImportProductSetsResponse. */ + class ImportProductSetsResponse implements IImportProductSetsResponse { + + /** + * Constructs a new ImportProductSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsResponse); + + /** ImportProductSetsResponse referenceImages. */ + public referenceImages: google.cloud.vision.v1p3beta1.IReferenceImage[]; + + /** ImportProductSetsResponse statuses. */ + public statuses: google.rpc.IStatus[]; + + /** + * Creates a new ImportProductSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsResponse instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IImportProductSetsResponse): google.cloud.vision.v1p3beta1.ImportProductSetsResponse; + + /** + * Encodes the specified ImportProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsResponse.verify|verify} messages. + * @param message ImportProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IImportProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsResponse.verify|verify} messages. + * @param message ImportProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IImportProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.ImportProductSetsResponse; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.ImportProductSetsResponse; + + /** + * Verifies an ImportProductSetsResponse message. + * @param message Plain 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 ImportProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.ImportProductSetsResponse; + + /** + * Creates a plain object from an ImportProductSetsResponse message. Also converts values to other types if specified. + * @param message ImportProductSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.ImportProductSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchOperationMetadata. */ + interface IBatchOperationMetadata { + + /** BatchOperationMetadata state */ + state?: (google.cloud.vision.v1p3beta1.BatchOperationMetadata.State|null); + + /** BatchOperationMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchOperationMetadata. */ + class BatchOperationMetadata implements IBatchOperationMetadata { + + /** + * Constructs a new BatchOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IBatchOperationMetadata); + + /** BatchOperationMetadata state. */ + public state: google.cloud.vision.v1p3beta1.BatchOperationMetadata.State; + + /** BatchOperationMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOperationMetadata instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IBatchOperationMetadata): google.cloud.vision.v1p3beta1.BatchOperationMetadata; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.BatchOperationMetadata; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.BatchOperationMetadata; + + /** + * Verifies a BatchOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.BatchOperationMetadata; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @param message BatchOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.BatchOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROCESSING = 1, + SUCCESSFUL = 2, + FAILED = 3, + CANCELLED = 4 + } + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation pages */ + pages?: (google.cloud.vision.v1p3beta1.IPage[]|null); + + /** TextAnnotation text */ + text?: (string|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ITextAnnotation); + + /** TextAnnotation pages. */ + public pages: google.cloud.vision.v1p3beta1.IPage[]; + + /** TextAnnotation text. */ + public text: string; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ITextAnnotation): google.cloud.vision.v1p3beta1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TextAnnotation { + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage; + + /** + * Verifies a DetectedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectedBreak. */ + interface IDetectedBreak { + + /** DetectedBreak type */ + type?: (google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType|null); + + /** DetectedBreak isPrefix */ + isPrefix?: (boolean|null); + } + + /** Represents a DetectedBreak. */ + class DetectedBreak implements IDetectedBreak { + + /** + * Constructs a new DetectedBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak); + + /** DetectedBreak type. */ + public type: google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType; + + /** DetectedBreak isPrefix. */ + public isPrefix: boolean; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedBreak instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak; + + /** + * Verifies a DetectedBreak message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedBreak + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @param message DetectedBreak + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DetectedBreak { + + /** BreakType enum. */ + enum BreakType { + UNKNOWN = 0, + SPACE = 1, + SURE_SPACE = 2, + EOL_SURE_SPACE = 3, + HYPHEN = 4, + LINE_BREAK = 5 + } + } + + /** Properties of a TextProperty. */ + interface ITextProperty { + + /** TextProperty detectedLanguages */ + detectedLanguages?: (google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage[]|null); + + /** TextProperty detectedBreak */ + detectedBreak?: (google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak|null); + } + + /** Represents a TextProperty. */ + class TextProperty implements ITextProperty { + + /** + * Constructs a new TextProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty); + + /** TextProperty detectedLanguages. */ + public detectedLanguages: google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage[]; + + /** TextProperty detectedBreak. */ + public detectedBreak?: (google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak|null); + + /** + * Creates a new TextProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns TextProperty instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty): google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty; + + /** + * Verifies a TextProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @param message TextProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Page. */ + interface IPage { + + /** Page property */ + property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Page width */ + width?: (number|null); + + /** Page height */ + height?: (number|null); + + /** Page blocks */ + blocks?: (google.cloud.vision.v1p3beta1.IBlock[]|null); + + /** Page confidence */ + confidence?: (number|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IPage); + + /** Page property. */ + public property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Page width. */ + public width: number; + + /** Page height. */ + public height: number; + + /** Page blocks. */ + public blocks: google.cloud.vision.v1p3beta1.IBlock[]; + + /** Page confidence. */ + public confidence: number; + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IPage): google.cloud.vision.v1p3beta1.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Page; + + /** + * Verifies a Page message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Block. */ + interface IBlock { + + /** Block property */ + property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox */ + boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Block paragraphs */ + paragraphs?: (google.cloud.vision.v1p3beta1.IParagraph[]|null); + + /** Block blockType */ + blockType?: (google.cloud.vision.v1p3beta1.Block.BlockType|null); + + /** Block confidence */ + confidence?: (number|null); + } + + /** Represents a Block. */ + class Block implements IBlock { + + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IBlock); + + /** Block property. */ + public property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Block paragraphs. */ + public paragraphs: google.cloud.vision.v1p3beta1.IParagraph[]; + + /** Block blockType. */ + public blockType: google.cloud.vision.v1p3beta1.Block.BlockType; + + /** Block confidence. */ + public confidence: number; + + /** + * Creates a new Block instance using the specified properties. + * @param [properties] Properties to set + * @returns Block instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IBlock): google.cloud.vision.v1p3beta1.Block; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Block message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Block; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Block; + + /** + * Verifies a Block message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Block + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Block; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @param message Block + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Block to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Block { + + /** BlockType enum. */ + enum BlockType { + UNKNOWN = 0, + TEXT = 1, + TABLE = 2, + PICTURE = 3, + RULER = 4, + BARCODE = 5 + } + } + + /** Properties of a Paragraph. */ + interface IParagraph { + + /** Paragraph property */ + property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox */ + boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Paragraph words */ + words?: (google.cloud.vision.v1p3beta1.IWord[]|null); + + /** Paragraph confidence */ + confidence?: (number|null); + } + + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { + + /** + * Constructs a new Paragraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IParagraph); + + /** Paragraph property. */ + public property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Paragraph words. */ + public words: google.cloud.vision.v1p3beta1.IWord[]; + + /** Paragraph confidence. */ + public confidence: number; + + /** + * Creates a new Paragraph instance using the specified properties. + * @param [properties] Properties to set + * @returns Paragraph instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IParagraph): google.cloud.vision.v1p3beta1.Paragraph; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Paragraph; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Paragraph; + + /** + * Verifies a Paragraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Paragraph + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Paragraph; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @param message Paragraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Paragraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Word. */ + interface IWord { + + /** Word property */ + property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox */ + boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Word symbols */ + symbols?: (google.cloud.vision.v1p3beta1.ISymbol[]|null); + + /** Word confidence */ + confidence?: (number|null); + } + + /** Represents a Word. */ + class Word implements IWord { + + /** + * Constructs a new Word. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IWord); + + /** Word property. */ + public property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Word symbols. */ + public symbols: google.cloud.vision.v1p3beta1.ISymbol[]; + + /** Word confidence. */ + public confidence: number; + + /** + * Creates a new Word instance using the specified properties. + * @param [properties] Properties to set + * @returns Word instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IWord): google.cloud.vision.v1p3beta1.Word; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Word message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Word; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Word; + + /** + * Verifies a Word message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Word + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Word; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @param message Word + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Word, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Word to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Symbol. */ + interface ISymbol { + + /** Symbol property */ + property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox */ + boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Symbol text */ + text?: (string|null); + + /** Symbol confidence */ + confidence?: (number|null); + } + + /** Represents a Symbol. */ + class Symbol implements ISymbol { + + /** + * Constructs a new Symbol. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.ISymbol); + + /** Symbol property. */ + public property?: (google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p3beta1.IBoundingPoly|null); + + /** Symbol text. */ + public text: string; + + /** Symbol confidence. */ + public confidence: number; + + /** + * Creates a new Symbol instance using the specified properties. + * @param [properties] Properties to set + * @returns Symbol instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.ISymbol): google.cloud.vision.v1p3beta1.Symbol; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.Symbol; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.Symbol; + + /** + * Verifies a Symbol message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Symbol + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.Symbol; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @param message Symbol + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Symbol to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetection. */ + interface IWebDetection { + + /** WebDetection webEntities */ + webEntities?: (google.cloud.vision.v1p3beta1.WebDetection.IWebEntity[]|null); + + /** WebDetection fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]|null); + + /** WebDetection partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]|null); + + /** WebDetection pagesWithMatchingImages */ + pagesWithMatchingImages?: (google.cloud.vision.v1p3beta1.WebDetection.IWebPage[]|null); + + /** WebDetection visuallySimilarImages */ + visuallySimilarImages?: (google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]|null); + + /** WebDetection bestGuessLabels */ + bestGuessLabels?: (google.cloud.vision.v1p3beta1.WebDetection.IWebLabel[]|null); + } + + /** Represents a WebDetection. */ + class WebDetection implements IWebDetection { + + /** + * Constructs a new WebDetection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.IWebDetection); + + /** WebDetection webEntities. */ + public webEntities: google.cloud.vision.v1p3beta1.WebDetection.IWebEntity[]; + + /** WebDetection fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]; + + /** WebDetection partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]; + + /** WebDetection pagesWithMatchingImages. */ + public pagesWithMatchingImages: google.cloud.vision.v1p3beta1.WebDetection.IWebPage[]; + + /** WebDetection visuallySimilarImages. */ + public visuallySimilarImages: google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]; + + /** WebDetection bestGuessLabels. */ + public bestGuessLabels: google.cloud.vision.v1p3beta1.WebDetection.IWebLabel[]; + + /** + * Creates a new WebDetection instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetection instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.IWebDetection): google.cloud.vision.v1p3beta1.WebDetection; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.WebDetection; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.WebDetection; + + /** + * Verifies a WebDetection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.WebDetection; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @param message WebDetection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.WebDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WebDetection { + + /** Properties of a WebEntity. */ + interface IWebEntity { + + /** WebEntity entityId */ + entityId?: (string|null); + + /** WebEntity score */ + score?: (number|null); + + /** WebEntity description */ + description?: (string|null); + } + + /** Represents a WebEntity. */ + class WebEntity implements IWebEntity { + + /** + * Constructs a new WebEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebEntity); + + /** WebEntity entityId. */ + public entityId: string; + + /** WebEntity score. */ + public score: number; + + /** WebEntity description. */ + public description: string; + + /** + * Creates a new WebEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns WebEntity instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebEntity): google.cloud.vision.v1p3beta1.WebDetection.WebEntity; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.WebDetection.WebEntity; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.WebDetection.WebEntity; + + /** + * Verifies a WebEntity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.WebDetection.WebEntity; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @param message WebEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.WebDetection.WebEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebImage. */ + interface IWebImage { + + /** WebImage url */ + url?: (string|null); + + /** WebImage score */ + score?: (number|null); + } + + /** Represents a WebImage. */ + class WebImage implements IWebImage { + + /** + * Constructs a new WebImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebImage); + + /** WebImage url. */ + public url: string; + + /** WebImage score. */ + public score: number; + + /** + * Creates a new WebImage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebImage instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebImage): google.cloud.vision.v1p3beta1.WebDetection.WebImage; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.WebDetection.WebImage; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.WebDetection.WebImage; + + /** + * Verifies a WebImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.WebDetection.WebImage; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @param message WebImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.WebDetection.WebImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebPage. */ + interface IWebPage { + + /** WebPage url */ + url?: (string|null); + + /** WebPage score */ + score?: (number|null); + + /** WebPage pageTitle */ + pageTitle?: (string|null); + + /** WebPage fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]|null); + + /** WebPage partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]|null); + } + + /** Represents a WebPage. */ + class WebPage implements IWebPage { + + /** + * Constructs a new WebPage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebPage); + + /** WebPage url. */ + public url: string; + + /** WebPage score. */ + public score: number; + + /** WebPage pageTitle. */ + public pageTitle: string; + + /** WebPage fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]; + + /** WebPage partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p3beta1.WebDetection.IWebImage[]; + + /** + * Creates a new WebPage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebPage instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebPage): google.cloud.vision.v1p3beta1.WebDetection.WebPage; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.WebDetection.WebPage; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.WebDetection.WebPage; + + /** + * Verifies a WebPage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebPage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.WebDetection.WebPage; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @param message WebPage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.WebDetection.WebPage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebPage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebLabel. */ + interface IWebLabel { + + /** WebLabel label */ + label?: (string|null); + + /** WebLabel languageCode */ + languageCode?: (string|null); + } + + /** Represents a WebLabel. */ + class WebLabel implements IWebLabel { + + /** + * Constructs a new WebLabel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebLabel); + + /** WebLabel label. */ + public label: string; + + /** WebLabel languageCode. */ + public languageCode: string; + + /** + * Creates a new WebLabel instance using the specified properties. + * @param [properties] Properties to set + * @returns WebLabel instance + */ + public static create(properties?: google.cloud.vision.v1p3beta1.WebDetection.IWebLabel): google.cloud.vision.v1p3beta1.WebDetection.WebLabel; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p3beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p3beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p3beta1.WebDetection.WebLabel; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p3beta1.WebDetection.WebLabel; + + /** + * Verifies a WebLabel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebLabel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p3beta1.WebDetection.WebLabel; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @param message WebLabel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p3beta1.WebDetection.WebLabel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebLabel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Namespace v1p4beta1. */ + namespace v1p4beta1 { + + /** Represents an ImageAnnotator */ + class ImageAnnotator extends $protobuf.rpc.Service { + + /** + * Constructs a new ImageAnnotator 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 ImageAnnotator 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): ImageAnnotator; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + */ + public batchAnnotateImages(request: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, callback: google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateImagesCallback): void; + + /** + * Calls BatchAnnotateImages. + * @param request BatchAnnotateImagesRequest message or plain object + * @returns Promise + */ + public batchAnnotateImages(request: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest): Promise; + + /** + * Calls BatchAnnotateFiles. + * @param request BatchAnnotateFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchAnnotateFilesResponse + */ + public batchAnnotateFiles(request: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, callback: google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateFilesCallback): void; + + /** + * Calls BatchAnnotateFiles. + * @param request BatchAnnotateFilesRequest message or plain object + * @returns Promise + */ + public batchAnnotateFiles(request: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest): Promise; + + /** + * Calls AsyncBatchAnnotateImages. + * @param request AsyncBatchAnnotateImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public asyncBatchAnnotateImages(request: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, callback: google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateImagesCallback): void; + + /** + * Calls AsyncBatchAnnotateImages. + * @param request AsyncBatchAnnotateImagesRequest message or plain object + * @returns Promise + */ + public asyncBatchAnnotateImages(request: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest): Promise; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, callback: google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateFilesCallback): void; + + /** + * Calls AsyncBatchAnnotateFiles. + * @param request AsyncBatchAnnotateFilesRequest message or plain object + * @returns Promise + */ + public asyncBatchAnnotateFiles(request: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest): Promise; + } + + namespace ImageAnnotator { + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#batchAnnotateImages}. + * @param error Error, if any + * @param [response] BatchAnnotateImagesResponse + */ + type BatchAnnotateImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#batchAnnotateFiles}. + * @param error Error, if any + * @param [response] BatchAnnotateFilesResponse + */ + type BatchAnnotateFilesCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#asyncBatchAnnotateImages}. + * @param error Error, if any + * @param [response] Operation + */ + type AsyncBatchAnnotateImagesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @param error Error, if any + * @param [response] Operation + */ + type AsyncBatchAnnotateFilesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Feature. */ + interface IFeature { + + /** Feature type */ + type?: (google.cloud.vision.v1p4beta1.Feature.Type|null); + + /** Feature maxResults */ + maxResults?: (number|null); + + /** Feature model */ + model?: (string|null); + } + + /** Represents a Feature. */ + class Feature implements IFeature { + + /** + * Constructs a new Feature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IFeature); + + /** Feature type. */ + public type: google.cloud.vision.v1p4beta1.Feature.Type; + + /** Feature maxResults. */ + public maxResults: number; + + /** Feature model. */ + public model: string; + + /** + * Creates a new Feature instance using the specified properties. + * @param [properties] Properties to set + * @returns Feature instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IFeature): google.cloud.vision.v1p4beta1.Feature; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Feature.verify|verify} messages. + * @param message Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Feature; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Feature; + + /** + * Verifies a Feature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Feature; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @param message Feature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Feature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Feature { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + FACE_DETECTION = 1, + LANDMARK_DETECTION = 2, + LOGO_DETECTION = 3, + LABEL_DETECTION = 4, + TEXT_DETECTION = 5, + DOCUMENT_TEXT_DETECTION = 11, + SAFE_SEARCH_DETECTION = 6, + IMAGE_PROPERTIES = 7, + CROP_HINTS = 9, + WEB_DETECTION = 10, + PRODUCT_SEARCH = 12, + OBJECT_LOCALIZATION = 19 + } + } + + /** Properties of an ImageSource. */ + interface IImageSource { + + /** ImageSource gcsImageUri */ + gcsImageUri?: (string|null); + + /** ImageSource imageUri */ + imageUri?: (string|null); + } + + /** Represents an ImageSource. */ + class ImageSource implements IImageSource { + + /** + * Constructs a new ImageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImageSource); + + /** ImageSource gcsImageUri. */ + public gcsImageUri: string; + + /** ImageSource imageUri. */ + public imageUri: string; + + /** + * Creates a new ImageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageSource instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImageSource): google.cloud.vision.v1p4beta1.ImageSource; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageSource.verify|verify} messages. + * @param message ImageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImageSource; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImageSource; + + /** + * Verifies an ImageSource message. + * @param message Plain 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 ImageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImageSource; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @param message ImageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image content */ + content?: (Uint8Array|null); + + /** Image source */ + source?: (google.cloud.vision.v1p4beta1.IImageSource|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImage); + + /** Image content. */ + public content: Uint8Array; + + /** Image source. */ + public source?: (google.cloud.vision.v1p4beta1.IImageSource|null); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImage): google.cloud.vision.v1p4beta1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Likelihood enum. */ + enum Likelihood { + UNKNOWN = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + + /** Properties of a FaceAnnotation. */ + interface IFaceAnnotation { + + /** FaceAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly */ + fdBoundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks */ + landmarks?: (google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark[]|null); + + /** FaceAnnotation rollAngle */ + rollAngle?: (number|null); + + /** FaceAnnotation panAngle */ + panAngle?: (number|null); + + /** FaceAnnotation tiltAngle */ + tiltAngle?: (number|null); + + /** FaceAnnotation detectionConfidence */ + detectionConfidence?: (number|null); + + /** FaceAnnotation landmarkingConfidence */ + landmarkingConfidence?: (number|null); + + /** FaceAnnotation joyLikelihood */ + joyLikelihood?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** FaceAnnotation sorrowLikelihood */ + sorrowLikelihood?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** FaceAnnotation angerLikelihood */ + angerLikelihood?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** FaceAnnotation surpriseLikelihood */ + surpriseLikelihood?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** FaceAnnotation underExposedLikelihood */ + underExposedLikelihood?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** FaceAnnotation blurredLikelihood */ + blurredLikelihood?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** FaceAnnotation headwearLikelihood */ + headwearLikelihood?: (google.cloud.vision.v1p4beta1.Likelihood|null); + } + + /** Represents a FaceAnnotation. */ + class FaceAnnotation implements IFaceAnnotation { + + /** + * Constructs a new FaceAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IFaceAnnotation); + + /** FaceAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** FaceAnnotation fdBoundingPoly. */ + public fdBoundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** FaceAnnotation landmarks. */ + public landmarks: google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark[]; + + /** FaceAnnotation rollAngle. */ + public rollAngle: number; + + /** FaceAnnotation panAngle. */ + public panAngle: number; + + /** FaceAnnotation tiltAngle. */ + public tiltAngle: number; + + /** FaceAnnotation detectionConfidence. */ + public detectionConfidence: number; + + /** FaceAnnotation landmarkingConfidence. */ + public landmarkingConfidence: number; + + /** FaceAnnotation joyLikelihood. */ + public joyLikelihood: google.cloud.vision.v1p4beta1.Likelihood; + + /** FaceAnnotation sorrowLikelihood. */ + public sorrowLikelihood: google.cloud.vision.v1p4beta1.Likelihood; + + /** FaceAnnotation angerLikelihood. */ + public angerLikelihood: google.cloud.vision.v1p4beta1.Likelihood; + + /** FaceAnnotation surpriseLikelihood. */ + public surpriseLikelihood: google.cloud.vision.v1p4beta1.Likelihood; + + /** FaceAnnotation underExposedLikelihood. */ + public underExposedLikelihood: google.cloud.vision.v1p4beta1.Likelihood; + + /** FaceAnnotation blurredLikelihood. */ + public blurredLikelihood: google.cloud.vision.v1p4beta1.Likelihood; + + /** FaceAnnotation headwearLikelihood. */ + public headwearLikelihood: google.cloud.vision.v1p4beta1.Likelihood; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IFaceAnnotation): google.cloud.vision.v1p4beta1.FaceAnnotation; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.FaceAnnotation; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.FaceAnnotation; + + /** + * Verifies a FaceAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.FaceAnnotation; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @param message FaceAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.FaceAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FaceAnnotation { + + /** Properties of a Landmark. */ + interface ILandmark { + + /** Landmark type */ + type?: (google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type|null); + + /** Landmark position */ + position?: (google.cloud.vision.v1p4beta1.IPosition|null); + } + + /** Represents a Landmark. */ + class Landmark implements ILandmark { + + /** + * Constructs a new Landmark. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark); + + /** Landmark type. */ + public type: google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type; + + /** Landmark position. */ + public position?: (google.cloud.vision.v1p4beta1.IPosition|null); + + /** + * Creates a new Landmark instance using the specified properties. + * @param [properties] Properties to set + * @returns Landmark instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark): google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @param message Landmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark; + + /** + * Verifies a Landmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Landmark + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @param message Landmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Landmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Landmark { + + /** Type enum. */ + enum Type { + UNKNOWN_LANDMARK = 0, + LEFT_EYE = 1, + RIGHT_EYE = 2, + LEFT_OF_LEFT_EYEBROW = 3, + RIGHT_OF_LEFT_EYEBROW = 4, + LEFT_OF_RIGHT_EYEBROW = 5, + RIGHT_OF_RIGHT_EYEBROW = 6, + MIDPOINT_BETWEEN_EYES = 7, + NOSE_TIP = 8, + UPPER_LIP = 9, + LOWER_LIP = 10, + MOUTH_LEFT = 11, + MOUTH_RIGHT = 12, + MOUTH_CENTER = 13, + NOSE_BOTTOM_RIGHT = 14, + NOSE_BOTTOM_LEFT = 15, + NOSE_BOTTOM_CENTER = 16, + LEFT_EYE_TOP_BOUNDARY = 17, + LEFT_EYE_RIGHT_CORNER = 18, + LEFT_EYE_BOTTOM_BOUNDARY = 19, + LEFT_EYE_LEFT_CORNER = 20, + RIGHT_EYE_TOP_BOUNDARY = 21, + RIGHT_EYE_RIGHT_CORNER = 22, + RIGHT_EYE_BOTTOM_BOUNDARY = 23, + RIGHT_EYE_LEFT_CORNER = 24, + LEFT_EYEBROW_UPPER_MIDPOINT = 25, + RIGHT_EYEBROW_UPPER_MIDPOINT = 26, + LEFT_EAR_TRAGION = 27, + RIGHT_EAR_TRAGION = 28, + LEFT_EYE_PUPIL = 29, + RIGHT_EYE_PUPIL = 30, + FOREHEAD_GLABELLA = 31, + CHIN_GNATHION = 32, + CHIN_LEFT_GONION = 33, + CHIN_RIGHT_GONION = 34 + } + } + } + + /** Properties of a LocationInfo. */ + interface ILocationInfo { + + /** LocationInfo latLng */ + latLng?: (google.type.ILatLng|null); + } + + /** Represents a LocationInfo. */ + class LocationInfo implements ILocationInfo { + + /** + * Constructs a new LocationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ILocationInfo); + + /** LocationInfo latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** + * Creates a new LocationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationInfo instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ILocationInfo): google.cloud.vision.v1p4beta1.LocationInfo; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.LocationInfo; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.LocationInfo; + + /** + * Verifies a LocationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.LocationInfo; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @param message LocationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Property. */ + interface IProperty { + + /** Property name */ + name?: (string|null); + + /** Property value */ + value?: (string|null); + + /** Property uint64Value */ + uint64Value?: (number|Long|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IProperty); + + /** Property name. */ + public name: string; + + /** Property value. */ + public value: string; + + /** Property uint64Value. */ + public uint64Value: (number|Long); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IProperty): google.cloud.vision.v1p4beta1.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Property.verify|verify} messages. + * @param message Property message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Property message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Property; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Property; + + /** + * Verifies a Property message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Property + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Property; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @param message Property + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Property, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Property to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EntityAnnotation. */ + interface IEntityAnnotation { + + /** EntityAnnotation mid */ + mid?: (string|null); + + /** EntityAnnotation locale */ + locale?: (string|null); + + /** EntityAnnotation description */ + description?: (string|null); + + /** EntityAnnotation score */ + score?: (number|null); + + /** EntityAnnotation confidence */ + confidence?: (number|null); + + /** EntityAnnotation topicality */ + topicality?: (number|null); + + /** EntityAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** EntityAnnotation locations */ + locations?: (google.cloud.vision.v1p4beta1.ILocationInfo[]|null); + + /** EntityAnnotation properties */ + properties?: (google.cloud.vision.v1p4beta1.IProperty[]|null); + } + + /** Represents an EntityAnnotation. */ + class EntityAnnotation implements IEntityAnnotation { + + /** + * Constructs a new EntityAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IEntityAnnotation); + + /** EntityAnnotation mid. */ + public mid: string; + + /** EntityAnnotation locale. */ + public locale: string; + + /** EntityAnnotation description. */ + public description: string; + + /** EntityAnnotation score. */ + public score: number; + + /** EntityAnnotation confidence. */ + public confidence: number; + + /** EntityAnnotation topicality. */ + public topicality: number; + + /** EntityAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** EntityAnnotation locations. */ + public locations: google.cloud.vision.v1p4beta1.ILocationInfo[]; + + /** EntityAnnotation properties. */ + public properties: google.cloud.vision.v1p4beta1.IProperty[]; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IEntityAnnotation): google.cloud.vision.v1p4beta1.EntityAnnotation; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.EntityAnnotation.verify|verify} messages. + * @param message EntityAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IEntityAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.EntityAnnotation; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.EntityAnnotation; + + /** + * Verifies an EntityAnnotation message. + * @param message Plain 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 EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.EntityAnnotation; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @param message EntityAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.EntityAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LocalizedObjectAnnotation. */ + interface ILocalizedObjectAnnotation { + + /** LocalizedObjectAnnotation mid */ + mid?: (string|null); + + /** LocalizedObjectAnnotation languageCode */ + languageCode?: (string|null); + + /** LocalizedObjectAnnotation name */ + name?: (string|null); + + /** LocalizedObjectAnnotation score */ + score?: (number|null); + + /** LocalizedObjectAnnotation boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + } + + /** Represents a LocalizedObjectAnnotation. */ + class LocalizedObjectAnnotation implements ILocalizedObjectAnnotation { + + /** + * Constructs a new LocalizedObjectAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation); + + /** LocalizedObjectAnnotation mid. */ + public mid: string; + + /** LocalizedObjectAnnotation languageCode. */ + public languageCode: string; + + /** LocalizedObjectAnnotation name. */ + public name: string; + + /** LocalizedObjectAnnotation score. */ + public score: number; + + /** LocalizedObjectAnnotation boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** + * Creates a new LocalizedObjectAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalizedObjectAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation): google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation; + + /** + * Encodes the specified LocalizedObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @param message LocalizedObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalizedObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @param message LocalizedObjectAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation; + + /** + * Verifies a LocalizedObjectAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalizedObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalizedObjectAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation; + + /** + * Creates a plain object from a LocalizedObjectAnnotation message. Also converts values to other types if specified. + * @param message LocalizedObjectAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalizedObjectAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SafeSearchAnnotation. */ + interface ISafeSearchAnnotation { + + /** SafeSearchAnnotation adult */ + adult?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** SafeSearchAnnotation spoof */ + spoof?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** SafeSearchAnnotation medical */ + medical?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** SafeSearchAnnotation violence */ + violence?: (google.cloud.vision.v1p4beta1.Likelihood|null); + + /** SafeSearchAnnotation racy */ + racy?: (google.cloud.vision.v1p4beta1.Likelihood|null); + } + + /** Represents a SafeSearchAnnotation. */ + class SafeSearchAnnotation implements ISafeSearchAnnotation { + + /** + * Constructs a new SafeSearchAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ISafeSearchAnnotation); + + /** SafeSearchAnnotation adult. */ + public adult: google.cloud.vision.v1p4beta1.Likelihood; + + /** SafeSearchAnnotation spoof. */ + public spoof: google.cloud.vision.v1p4beta1.Likelihood; + + /** SafeSearchAnnotation medical. */ + public medical: google.cloud.vision.v1p4beta1.Likelihood; + + /** SafeSearchAnnotation violence. */ + public violence: google.cloud.vision.v1p4beta1.Likelihood; + + /** SafeSearchAnnotation racy. */ + public racy: google.cloud.vision.v1p4beta1.Likelihood; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns SafeSearchAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ISafeSearchAnnotation): google.cloud.vision.v1p4beta1.SafeSearchAnnotation; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.SafeSearchAnnotation.verify|verify} messages. + * @param message SafeSearchAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ISafeSearchAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.SafeSearchAnnotation; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.SafeSearchAnnotation; + + /** + * Verifies a SafeSearchAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafeSearchAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.SafeSearchAnnotation; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @param message SafeSearchAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.SafeSearchAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LatLongRect. */ + interface ILatLongRect { + + /** LatLongRect minLatLng */ + minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng */ + maxLatLng?: (google.type.ILatLng|null); + } + + /** Represents a LatLongRect. */ + class LatLongRect implements ILatLongRect { + + /** + * Constructs a new LatLongRect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ILatLongRect); + + /** LatLongRect minLatLng. */ + public minLatLng?: (google.type.ILatLng|null); + + /** LatLongRect maxLatLng. */ + public maxLatLng?: (google.type.ILatLng|null); + + /** + * Creates a new LatLongRect instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLongRect instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ILatLongRect): google.cloud.vision.v1p4beta1.LatLongRect; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p4beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.LatLongRect.verify|verify} messages. + * @param message LatLongRect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ILatLongRect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.LatLongRect; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.LatLongRect; + + /** + * Verifies a LatLongRect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLongRect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.LatLongRect; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @param message LatLongRect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.LatLongRect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLongRect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo color */ + color?: (google.type.IColor|null); + + /** ColorInfo score */ + score?: (number|null); + + /** ColorInfo pixelFraction */ + pixelFraction?: (number|null); + } + + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { + + /** + * Constructs a new ColorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IColorInfo); + + /** ColorInfo color. */ + public color?: (google.type.IColor|null); + + /** ColorInfo score. */ + public score: number; + + /** ColorInfo pixelFraction. */ + public pixelFraction: number; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColorInfo instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IColorInfo): google.cloud.vision.v1p4beta1.ColorInfo; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ColorInfo; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ColorInfo; + + /** + * Verifies a ColorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ColorInfo; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DominantColorsAnnotation. */ + interface IDominantColorsAnnotation { + + /** DominantColorsAnnotation colors */ + colors?: (google.cloud.vision.v1p4beta1.IColorInfo[]|null); + } + + /** Represents a DominantColorsAnnotation. */ + class DominantColorsAnnotation implements IDominantColorsAnnotation { + + /** + * Constructs a new DominantColorsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IDominantColorsAnnotation); + + /** DominantColorsAnnotation colors. */ + public colors: google.cloud.vision.v1p4beta1.IColorInfo[]; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns DominantColorsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IDominantColorsAnnotation): google.cloud.vision.v1p4beta1.DominantColorsAnnotation; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DominantColorsAnnotation.verify|verify} messages. + * @param message DominantColorsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IDominantColorsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.DominantColorsAnnotation; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.DominantColorsAnnotation; + + /** + * Verifies a DominantColorsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DominantColorsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.DominantColorsAnnotation; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @param message DominantColorsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.DominantColorsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageProperties. */ + interface IImageProperties { + + /** ImageProperties dominantColors */ + dominantColors?: (google.cloud.vision.v1p4beta1.IDominantColorsAnnotation|null); + } + + /** Represents an ImageProperties. */ + class ImageProperties implements IImageProperties { + + /** + * Constructs a new ImageProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImageProperties); + + /** ImageProperties dominantColors. */ + public dominantColors?: (google.cloud.vision.v1p4beta1.IDominantColorsAnnotation|null); + + /** + * Creates a new ImageProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageProperties instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImageProperties): google.cloud.vision.v1p4beta1.ImageProperties; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageProperties.verify|verify} messages. + * @param message ImageProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImageProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImageProperties; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImageProperties; + + /** + * Verifies an ImageProperties message. + * @param message Plain 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 ImageProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImageProperties; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @param message ImageProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImageProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHint. */ + interface ICropHint { + + /** CropHint boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** CropHint confidence */ + confidence?: (number|null); + + /** CropHint importanceFraction */ + importanceFraction?: (number|null); + } + + /** Represents a CropHint. */ + class CropHint implements ICropHint { + + /** + * Constructs a new CropHint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ICropHint); + + /** CropHint boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** CropHint confidence. */ + public confidence: number; + + /** CropHint importanceFraction. */ + public importanceFraction: number; + + /** + * Creates a new CropHint instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHint instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ICropHint): google.cloud.vision.v1p4beta1.CropHint; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHint.verify|verify} messages. + * @param message CropHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ICropHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.CropHint; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.CropHint; + + /** + * Verifies a CropHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.CropHint; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @param message CropHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.CropHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsAnnotation. */ + interface ICropHintsAnnotation { + + /** CropHintsAnnotation cropHints */ + cropHints?: (google.cloud.vision.v1p4beta1.ICropHint[]|null); + } + + /** Represents a CropHintsAnnotation. */ + class CropHintsAnnotation implements ICropHintsAnnotation { + + /** + * Constructs a new CropHintsAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ICropHintsAnnotation); + + /** CropHintsAnnotation cropHints. */ + public cropHints: google.cloud.vision.v1p4beta1.ICropHint[]; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ICropHintsAnnotation): google.cloud.vision.v1p4beta1.CropHintsAnnotation; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsAnnotation.verify|verify} messages. + * @param message CropHintsAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ICropHintsAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.CropHintsAnnotation; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.CropHintsAnnotation; + + /** + * Verifies a CropHintsAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.CropHintsAnnotation; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @param message CropHintsAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.CropHintsAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CropHintsParams. */ + interface ICropHintsParams { + + /** CropHintsParams aspectRatios */ + aspectRatios?: (number[]|null); + } + + /** Represents a CropHintsParams. */ + class CropHintsParams implements ICropHintsParams { + + /** + * Constructs a new CropHintsParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ICropHintsParams); + + /** CropHintsParams aspectRatios. */ + public aspectRatios: number[]; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @param [properties] Properties to set + * @returns CropHintsParams instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ICropHintsParams): google.cloud.vision.v1p4beta1.CropHintsParams; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsParams.verify|verify} messages. + * @param message CropHintsParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ICropHintsParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.CropHintsParams; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.CropHintsParams; + + /** + * Verifies a CropHintsParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CropHintsParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.CropHintsParams; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @param message CropHintsParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.CropHintsParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CropHintsParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetectionParams. */ + interface IWebDetectionParams { + + /** WebDetectionParams includeGeoResults */ + includeGeoResults?: (boolean|null); + } + + /** Represents a WebDetectionParams. */ + class WebDetectionParams implements IWebDetectionParams { + + /** + * Constructs a new WebDetectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IWebDetectionParams); + + /** WebDetectionParams includeGeoResults. */ + public includeGeoResults: boolean; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetectionParams instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IWebDetectionParams): google.cloud.vision.v1p4beta1.WebDetectionParams; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetectionParams.verify|verify} messages. + * @param message WebDetectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IWebDetectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.WebDetectionParams; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.WebDetectionParams; + + /** + * Verifies a WebDetectionParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.WebDetectionParams; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @param message WebDetectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.WebDetectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageContext. */ + interface IImageContext { + + /** ImageContext latLongRect */ + latLongRect?: (google.cloud.vision.v1p4beta1.ILatLongRect|null); + + /** ImageContext languageHints */ + languageHints?: (string[]|null); + + /** ImageContext cropHintsParams */ + cropHintsParams?: (google.cloud.vision.v1p4beta1.ICropHintsParams|null); + + /** ImageContext productSearchParams */ + productSearchParams?: (google.cloud.vision.v1p4beta1.IProductSearchParams|null); + + /** ImageContext webDetectionParams */ + webDetectionParams?: (google.cloud.vision.v1p4beta1.IWebDetectionParams|null); + } + + /** Represents an ImageContext. */ + class ImageContext implements IImageContext { + + /** + * Constructs a new ImageContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImageContext); + + /** ImageContext latLongRect. */ + public latLongRect?: (google.cloud.vision.v1p4beta1.ILatLongRect|null); + + /** ImageContext languageHints. */ + public languageHints: string[]; + + /** ImageContext cropHintsParams. */ + public cropHintsParams?: (google.cloud.vision.v1p4beta1.ICropHintsParams|null); + + /** ImageContext productSearchParams. */ + public productSearchParams?: (google.cloud.vision.v1p4beta1.IProductSearchParams|null); + + /** ImageContext webDetectionParams. */ + public webDetectionParams?: (google.cloud.vision.v1p4beta1.IWebDetectionParams|null); + + /** + * Creates a new ImageContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageContext instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImageContext): google.cloud.vision.v1p4beta1.ImageContext; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageContext.verify|verify} messages. + * @param message ImageContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImageContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImageContext; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImageContext; + + /** + * Verifies an ImageContext message. + * @param message Plain 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 ImageContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImageContext; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @param message ImageContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImageContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageRequest. */ + interface IAnnotateImageRequest { + + /** AnnotateImageRequest image */ + image?: (google.cloud.vision.v1p4beta1.IImage|null); + + /** AnnotateImageRequest features */ + features?: (google.cloud.vision.v1p4beta1.IFeature[]|null); + + /** AnnotateImageRequest imageContext */ + imageContext?: (google.cloud.vision.v1p4beta1.IImageContext|null); + } + + /** Represents an AnnotateImageRequest. */ + class AnnotateImageRequest implements IAnnotateImageRequest { + + /** + * Constructs a new AnnotateImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAnnotateImageRequest); + + /** AnnotateImageRequest image. */ + public image?: (google.cloud.vision.v1p4beta1.IImage|null); + + /** AnnotateImageRequest features. */ + public features: google.cloud.vision.v1p4beta1.IFeature[]; + + /** AnnotateImageRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p4beta1.IImageContext|null); + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAnnotateImageRequest): google.cloud.vision.v1p4beta1.AnnotateImageRequest; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageRequest.verify|verify} messages. + * @param message AnnotateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAnnotateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AnnotateImageRequest; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AnnotateImageRequest; + + /** + * Verifies an AnnotateImageRequest message. + * @param message Plain 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 AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AnnotateImageRequest; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @param message AnnotateImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AnnotateImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageAnnotationContext. */ + interface IImageAnnotationContext { + + /** ImageAnnotationContext uri */ + uri?: (string|null); + + /** ImageAnnotationContext pageNumber */ + pageNumber?: (number|null); + } + + /** Represents an ImageAnnotationContext. */ + class ImageAnnotationContext implements IImageAnnotationContext { + + /** + * Constructs a new ImageAnnotationContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImageAnnotationContext); + + /** ImageAnnotationContext uri. */ + public uri: string; + + /** ImageAnnotationContext pageNumber. */ + public pageNumber: number; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageAnnotationContext instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImageAnnotationContext): google.cloud.vision.v1p4beta1.ImageAnnotationContext; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageAnnotationContext.verify|verify} messages. + * @param message ImageAnnotationContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImageAnnotationContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImageAnnotationContext; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImageAnnotationContext; + + /** + * Verifies an ImageAnnotationContext message. + * @param message Plain 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 ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageAnnotationContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImageAnnotationContext; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @param message ImageAnnotationContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImageAnnotationContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateImageResponse. */ + interface IAnnotateImageResponse { + + /** AnnotateImageResponse faceAnnotations */ + faceAnnotations?: (google.cloud.vision.v1p4beta1.IFaceAnnotation[]|null); + + /** AnnotateImageResponse landmarkAnnotations */ + landmarkAnnotations?: (google.cloud.vision.v1p4beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse logoAnnotations */ + logoAnnotations?: (google.cloud.vision.v1p4beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse labelAnnotations */ + labelAnnotations?: (google.cloud.vision.v1p4beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse localizedObjectAnnotations */ + localizedObjectAnnotations?: (google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation[]|null); + + /** AnnotateImageResponse textAnnotations */ + textAnnotations?: (google.cloud.vision.v1p4beta1.IEntityAnnotation[]|null); + + /** AnnotateImageResponse fullTextAnnotation */ + fullTextAnnotation?: (google.cloud.vision.v1p4beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation */ + safeSearchAnnotation?: (google.cloud.vision.v1p4beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation */ + imagePropertiesAnnotation?: (google.cloud.vision.v1p4beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation */ + cropHintsAnnotation?: (google.cloud.vision.v1p4beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection */ + webDetection?: (google.cloud.vision.v1p4beta1.IWebDetection|null); + + /** AnnotateImageResponse productSearchResults */ + productSearchResults?: (google.cloud.vision.v1p4beta1.IProductSearchResults|null); + + /** AnnotateImageResponse error */ + error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context */ + context?: (google.cloud.vision.v1p4beta1.IImageAnnotationContext|null); + } + + /** Represents an AnnotateImageResponse. */ + class AnnotateImageResponse implements IAnnotateImageResponse { + + /** + * Constructs a new AnnotateImageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAnnotateImageResponse); + + /** AnnotateImageResponse faceAnnotations. */ + public faceAnnotations: google.cloud.vision.v1p4beta1.IFaceAnnotation[]; + + /** AnnotateImageResponse landmarkAnnotations. */ + public landmarkAnnotations: google.cloud.vision.v1p4beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse logoAnnotations. */ + public logoAnnotations: google.cloud.vision.v1p4beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse labelAnnotations. */ + public labelAnnotations: google.cloud.vision.v1p4beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse localizedObjectAnnotations. */ + public localizedObjectAnnotations: google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation[]; + + /** AnnotateImageResponse textAnnotations. */ + public textAnnotations: google.cloud.vision.v1p4beta1.IEntityAnnotation[]; + + /** AnnotateImageResponse fullTextAnnotation. */ + public fullTextAnnotation?: (google.cloud.vision.v1p4beta1.ITextAnnotation|null); + + /** AnnotateImageResponse safeSearchAnnotation. */ + public safeSearchAnnotation?: (google.cloud.vision.v1p4beta1.ISafeSearchAnnotation|null); + + /** AnnotateImageResponse imagePropertiesAnnotation. */ + public imagePropertiesAnnotation?: (google.cloud.vision.v1p4beta1.IImageProperties|null); + + /** AnnotateImageResponse cropHintsAnnotation. */ + public cropHintsAnnotation?: (google.cloud.vision.v1p4beta1.ICropHintsAnnotation|null); + + /** AnnotateImageResponse webDetection. */ + public webDetection?: (google.cloud.vision.v1p4beta1.IWebDetection|null); + + /** AnnotateImageResponse productSearchResults. */ + public productSearchResults?: (google.cloud.vision.v1p4beta1.IProductSearchResults|null); + + /** AnnotateImageResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** AnnotateImageResponse context. */ + public context?: (google.cloud.vision.v1p4beta1.IImageAnnotationContext|null); + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateImageResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAnnotateImageResponse): google.cloud.vision.v1p4beta1.AnnotateImageResponse; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageResponse.verify|verify} messages. + * @param message AnnotateImageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAnnotateImageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AnnotateImageResponse; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AnnotateImageResponse; + + /** + * Verifies an AnnotateImageResponse message. + * @param message Plain 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 AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateImageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AnnotateImageResponse; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @param message AnnotateImageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AnnotateImageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateFileResponse. */ + interface IAnnotateFileResponse { + + /** AnnotateFileResponse inputConfig */ + inputConfig?: (google.cloud.vision.v1p4beta1.IInputConfig|null); + + /** AnnotateFileResponse responses */ + responses?: (google.cloud.vision.v1p4beta1.IAnnotateImageResponse[]|null); + + /** AnnotateFileResponse totalPages */ + totalPages?: (number|null); + } + + /** Represents an AnnotateFileResponse. */ + class AnnotateFileResponse implements IAnnotateFileResponse { + + /** + * Constructs a new AnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAnnotateFileResponse); + + /** AnnotateFileResponse inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p4beta1.IInputConfig|null); + + /** AnnotateFileResponse responses. */ + public responses: google.cloud.vision.v1p4beta1.IAnnotateImageResponse[]; + + /** AnnotateFileResponse totalPages. */ + public totalPages: number; + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAnnotateFileResponse): google.cloud.vision.v1p4beta1.AnnotateFileResponse; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileResponse.verify|verify} messages. + * @param message AnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AnnotateFileResponse; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AnnotateFileResponse; + + /** + * Verifies an AnnotateFileResponse message. + * @param message Plain 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 AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AnnotateFileResponse; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @param message AnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesRequest. */ + interface IBatchAnnotateImagesRequest { + + /** BatchAnnotateImagesRequest requests */ + requests?: (google.cloud.vision.v1p4beta1.IAnnotateImageRequest[]|null); + } + + /** Represents a BatchAnnotateImagesRequest. */ + class BatchAnnotateImagesRequest implements IBatchAnnotateImagesRequest { + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest); + + /** BatchAnnotateImagesRequest requests. */ + public requests: google.cloud.vision.v1p4beta1.IAnnotateImageRequest[]; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest): google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @param message BatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateImagesResponse. */ + interface IBatchAnnotateImagesResponse { + + /** BatchAnnotateImagesResponse responses */ + responses?: (google.cloud.vision.v1p4beta1.IAnnotateImageResponse[]|null); + } + + /** Represents a BatchAnnotateImagesResponse. */ + class BatchAnnotateImagesResponse implements IBatchAnnotateImagesResponse { + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse); + + /** BatchAnnotateImagesResponse responses. */ + public responses: google.cloud.vision.v1p4beta1.IAnnotateImageResponse[]; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse): google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @param message BatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @param message BatchAnnotateImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotateFileRequest. */ + interface IAnnotateFileRequest { + + /** AnnotateFileRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1p4beta1.IInputConfig|null); + + /** AnnotateFileRequest features */ + features?: (google.cloud.vision.v1p4beta1.IFeature[]|null); + + /** AnnotateFileRequest imageContext */ + imageContext?: (google.cloud.vision.v1p4beta1.IImageContext|null); + + /** AnnotateFileRequest pages */ + pages?: (number[]|null); + } + + /** Represents an AnnotateFileRequest. */ + class AnnotateFileRequest implements IAnnotateFileRequest { + + /** + * Constructs a new AnnotateFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAnnotateFileRequest); + + /** AnnotateFileRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p4beta1.IInputConfig|null); + + /** AnnotateFileRequest features. */ + public features: google.cloud.vision.v1p4beta1.IFeature[]; + + /** AnnotateFileRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p4beta1.IImageContext|null); + + /** AnnotateFileRequest pages. */ + public pages: number[]; + + /** + * Creates a new AnnotateFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateFileRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAnnotateFileRequest): google.cloud.vision.v1p4beta1.AnnotateFileRequest; + + /** + * Encodes the specified AnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileRequest.verify|verify} messages. + * @param message AnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileRequest.verify|verify} messages. + * @param message AnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AnnotateFileRequest; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AnnotateFileRequest; + + /** + * Verifies an AnnotateFileRequest message. + * @param message Plain 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 AnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AnnotateFileRequest; + + /** + * Creates a plain object from an AnnotateFileRequest message. Also converts values to other types if specified. + * @param message AnnotateFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AnnotateFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateFilesRequest. */ + interface IBatchAnnotateFilesRequest { + + /** BatchAnnotateFilesRequest requests */ + requests?: (google.cloud.vision.v1p4beta1.IAnnotateFileRequest[]|null); + } + + /** Represents a BatchAnnotateFilesRequest. */ + class BatchAnnotateFilesRequest implements IBatchAnnotateFilesRequest { + + /** + * Constructs a new BatchAnnotateFilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest); + + /** BatchAnnotateFilesRequest requests. */ + public requests: google.cloud.vision.v1p4beta1.IAnnotateFileRequest[]; + + /** + * Creates a new BatchAnnotateFilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateFilesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest): google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest; + + /** + * Encodes the specified BatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.verify|verify} messages. + * @param message BatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.verify|verify} messages. + * @param message BatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest; + + /** + * Verifies a BatchAnnotateFilesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateFilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest; + + /** + * Creates a plain object from a BatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @param message BatchAnnotateFilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateFilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchAnnotateFilesResponse. */ + interface IBatchAnnotateFilesResponse { + + /** BatchAnnotateFilesResponse responses */ + responses?: (google.cloud.vision.v1p4beta1.IAnnotateFileResponse[]|null); + } + + /** Represents a BatchAnnotateFilesResponse. */ + class BatchAnnotateFilesResponse implements IBatchAnnotateFilesResponse { + + /** + * Constructs a new BatchAnnotateFilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse); + + /** BatchAnnotateFilesResponse responses. */ + public responses: google.cloud.vision.v1p4beta1.IAnnotateFileResponse[]; + + /** + * Creates a new BatchAnnotateFilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchAnnotateFilesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse): google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse; + + /** + * Encodes the specified BatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.verify|verify} messages. + * @param message BatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.verify|verify} messages. + * @param message BatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse; + + /** + * Verifies a BatchAnnotateFilesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchAnnotateFilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse; + + /** + * Creates a plain object from a BatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @param message BatchAnnotateFilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchAnnotateFilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileRequest. */ + interface IAsyncAnnotateFileRequest { + + /** AsyncAnnotateFileRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1p4beta1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features */ + features?: (google.cloud.vision.v1p4beta1.IFeature[]|null); + + /** AsyncAnnotateFileRequest imageContext */ + imageContext?: (google.cloud.vision.v1p4beta1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig */ + outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileRequest. */ + class AsyncAnnotateFileRequest implements IAsyncAnnotateFileRequest { + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest); + + /** AsyncAnnotateFileRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p4beta1.IInputConfig|null); + + /** AsyncAnnotateFileRequest features. */ + public features: google.cloud.vision.v1p4beta1.IFeature[]; + + /** AsyncAnnotateFileRequest imageContext. */ + public imageContext?: (google.cloud.vision.v1p4beta1.IImageContext|null); + + /** AsyncAnnotateFileRequest outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest): google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @param message AsyncAnnotateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @param message Plain 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 AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncAnnotateFileResponse. */ + interface IAsyncAnnotateFileResponse { + + /** AsyncAnnotateFileResponse outputConfig */ + outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + } + + /** Represents an AsyncAnnotateFileResponse. */ + class AsyncAnnotateFileResponse implements IAsyncAnnotateFileResponse { + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse); + + /** AsyncAnnotateFileResponse outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncAnnotateFileResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse): google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @param message AsyncAnnotateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @param message Plain 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 AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncAnnotateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @param message AsyncAnnotateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateImagesRequest. */ + interface IAsyncBatchAnnotateImagesRequest { + + /** AsyncBatchAnnotateImagesRequest requests */ + requests?: (google.cloud.vision.v1p4beta1.IAnnotateImageRequest[]|null); + + /** AsyncBatchAnnotateImagesRequest outputConfig */ + outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + } + + /** Represents an AsyncBatchAnnotateImagesRequest. */ + class AsyncBatchAnnotateImagesRequest implements IAsyncBatchAnnotateImagesRequest { + + /** + * Constructs a new AsyncBatchAnnotateImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest); + + /** AsyncBatchAnnotateImagesRequest requests. */ + public requests: google.cloud.vision.v1p4beta1.IAnnotateImageRequest[]; + + /** AsyncBatchAnnotateImagesRequest outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + + /** + * Creates a new AsyncBatchAnnotateImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest; + + /** + * Verifies an AsyncBatchAnnotateImagesRequest message. + * @param message Plain 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 AsyncBatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateImagesResponse. */ + interface IAsyncBatchAnnotateImagesResponse { + + /** AsyncBatchAnnotateImagesResponse outputConfig */ + outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + } + + /** Represents an AsyncBatchAnnotateImagesResponse. */ + class AsyncBatchAnnotateImagesResponse implements IAsyncBatchAnnotateImagesResponse { + + /** + * Constructs a new AsyncBatchAnnotateImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse); + + /** AsyncBatchAnnotateImagesResponse outputConfig. */ + public outputConfig?: (google.cloud.vision.v1p4beta1.IOutputConfig|null); + + /** + * Creates a new AsyncBatchAnnotateImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse; + + /** + * Verifies an AsyncBatchAnnotateImagesResponse message. + * @param message Plain 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 AsyncBatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesRequest. */ + interface IAsyncBatchAnnotateFilesRequest { + + /** AsyncBatchAnnotateFilesRequest requests */ + requests?: (google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest[]|null); + } + + /** Represents an AsyncBatchAnnotateFilesRequest. */ + class AsyncBatchAnnotateFilesRequest implements IAsyncBatchAnnotateFilesRequest { + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest); + + /** AsyncBatchAnnotateFilesRequest requests. */ + public requests: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest[]; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @param message Plain 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 AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AsyncBatchAnnotateFilesResponse. */ + interface IAsyncBatchAnnotateFilesResponse { + + /** AsyncBatchAnnotateFilesResponse responses */ + responses?: (google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse[]|null); + } + + /** Represents an AsyncBatchAnnotateFilesResponse. */ + class AsyncBatchAnnotateFilesResponse implements IAsyncBatchAnnotateFilesResponse { + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse); + + /** AsyncBatchAnnotateFilesResponse responses. */ + public responses: google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse[]; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AsyncBatchAnnotateFilesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @param message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @param message Plain 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 AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AsyncBatchAnnotateFilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @param message AsyncBatchAnnotateFilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.vision.v1p4beta1.IGcsSource|null); + + /** InputConfig content */ + content?: (Uint8Array|null); + + /** InputConfig mimeType */ + mimeType?: (string|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.vision.v1p4beta1.IGcsSource|null); + + /** InputConfig content. */ + public content: Uint8Array; + + /** InputConfig mimeType. */ + public mimeType: string; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IInputConfig): google.cloud.vision.v1p4beta1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.vision.v1p4beta1.IGcsDestination|null); + + /** OutputConfig batchSize */ + batchSize?: (number|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.vision.v1p4beta1.IGcsDestination|null); + + /** OutputConfig batchSize. */ + public batchSize: number; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IOutputConfig): google.cloud.vision.v1p4beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource uri */ + uri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IGcsSource); + + /** GcsSource uri. */ + public uri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IGcsSource): google.cloud.vision.v1p4beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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 uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IGcsDestination): google.cloud.vision.v1p4beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata state */ + state?: (google.cloud.vision.v1p4beta1.OperationMetadata.State|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 OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IOperationMetadata); + + /** OperationMetadata state. */ + public state: google.cloud.vision.v1p4beta1.OperationMetadata.State; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IOperationMetadata): google.cloud.vision.v1p4beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p4beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace OperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATED = 1, + RUNNING = 2, + DONE = 3, + CANCELLED = 4 + } + } + + /** Properties of a Vertex. */ + interface IVertex { + + /** Vertex x */ + x?: (number|null); + + /** Vertex y */ + y?: (number|null); + } + + /** Represents a Vertex. */ + class Vertex implements IVertex { + + /** + * Constructs a new Vertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IVertex); + + /** Vertex x. */ + public x: number; + + /** Vertex y. */ + public y: number; + + /** + * Creates a new Vertex instance using the specified properties. + * @param [properties] Properties to set + * @returns Vertex instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IVertex): google.cloud.vision.v1p4beta1.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Vertex.verify|verify} messages. + * @param message Vertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Vertex; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Vertex; + + /** + * Verifies a Vertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Vertex; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @param message Vertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Vertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vertex 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.vision.v1p4beta1.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.vision.v1p4beta1.INormalizedVertex): google.cloud.vision.v1p4beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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 vertices */ + vertices?: (google.cloud.vision.v1p4beta1.IVertex[]|null); + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.vision.v1p4beta1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.vision.v1p4beta1.IVertex[]; + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.vision.v1p4beta1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IBoundingPoly): google.cloud.vision.v1p4beta1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Position. */ + interface IPosition { + + /** Position x */ + x?: (number|null); + + /** Position y */ + y?: (number|null); + + /** Position z */ + z?: (number|null); + } + + /** Represents a Position. */ + class Position implements IPosition { + + /** + * Constructs a new Position. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IPosition); + + /** Position x. */ + public x: number; + + /** Position y. */ + public y: number; + + /** Position z. */ + public z: number; + + /** + * Creates a new Position instance using the specified properties. + * @param [properties] Properties to set + * @returns Position instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IPosition): google.cloud.vision.v1p4beta1.Position; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Position.verify|verify} messages. + * @param message Position message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Position message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Position; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Position; + + /** + * Verifies a Position message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Position + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Position; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @param message Position + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Position, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Position to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProductSearchParams. */ + interface IProductSearchParams { + + /** ProductSearchParams boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** ProductSearchParams productSet */ + productSet?: (string|null); + + /** ProductSearchParams productCategories */ + productCategories?: (string[]|null); + + /** ProductSearchParams filter */ + filter?: (string|null); + } + + /** Represents a ProductSearchParams. */ + class ProductSearchParams implements IProductSearchParams { + + /** + * Constructs a new ProductSearchParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IProductSearchParams); + + /** ProductSearchParams boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** ProductSearchParams productSet. */ + public productSet: string; + + /** ProductSearchParams productCategories. */ + public productCategories: string[]; + + /** ProductSearchParams filter. */ + public filter: string; + + /** + * Creates a new ProductSearchParams instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSearchParams instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IProductSearchParams): google.cloud.vision.v1p4beta1.ProductSearchParams; + + /** + * Encodes the specified ProductSearchParams message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchParams.verify|verify} messages. + * @param message ProductSearchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IProductSearchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSearchParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchParams.verify|verify} messages. + * @param message ProductSearchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IProductSearchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ProductSearchParams; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ProductSearchParams; + + /** + * Verifies a ProductSearchParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSearchParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSearchParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ProductSearchParams; + + /** + * Creates a plain object from a ProductSearchParams message. Also converts values to other types if specified. + * @param message ProductSearchParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ProductSearchParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSearchParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProductSearchResults. */ + interface IProductSearchResults { + + /** ProductSearchResults indexTime */ + indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSearchResults results */ + results?: (google.cloud.vision.v1p4beta1.ProductSearchResults.IResult[]|null); + + /** ProductSearchResults productGroupedResults */ + productGroupedResults?: (google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult[]|null); + } + + /** Represents a ProductSearchResults. */ + class ProductSearchResults implements IProductSearchResults { + + /** + * Constructs a new ProductSearchResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IProductSearchResults); + + /** ProductSearchResults indexTime. */ + public indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSearchResults results. */ + public results: google.cloud.vision.v1p4beta1.ProductSearchResults.IResult[]; + + /** ProductSearchResults productGroupedResults. */ + public productGroupedResults: google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult[]; + + /** + * Creates a new ProductSearchResults instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSearchResults instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IProductSearchResults): google.cloud.vision.v1p4beta1.ProductSearchResults; + + /** + * Encodes the specified ProductSearchResults message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.verify|verify} messages. + * @param message ProductSearchResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IProductSearchResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSearchResults message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.verify|verify} messages. + * @param message ProductSearchResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IProductSearchResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ProductSearchResults; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ProductSearchResults; + + /** + * Verifies a ProductSearchResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSearchResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSearchResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ProductSearchResults; + + /** + * Creates a plain object from a ProductSearchResults message. Also converts values to other types if specified. + * @param message ProductSearchResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ProductSearchResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSearchResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ProductSearchResults { + + /** Properties of a Result. */ + interface IResult { + + /** Result product */ + product?: (google.cloud.vision.v1p4beta1.IProduct|null); + + /** Result score */ + score?: (number|null); + + /** Result image */ + image?: (string|null); + } + + /** Represents a Result. */ + class Result implements IResult { + + /** + * Constructs a new Result. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ProductSearchResults.IResult); + + /** Result product. */ + public product?: (google.cloud.vision.v1p4beta1.IProduct|null); + + /** Result score. */ + public score: number; + + /** Result image. */ + public image: string; + + /** + * Creates a new Result instance using the specified properties. + * @param [properties] Properties to set + * @returns Result instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ProductSearchResults.IResult): google.cloud.vision.v1p4beta1.ProductSearchResults.Result; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ProductSearchResults.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.Result.verify|verify} messages. + * @param message Result message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ProductSearchResults.IResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Result message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ProductSearchResults.Result; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ProductSearchResults.Result; + + /** + * Verifies a Result message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Result + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ProductSearchResults.Result; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @param message Result + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ProductSearchResults.Result, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Result to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GroupedResult. */ + interface IGroupedResult { + + /** GroupedResult boundingPoly */ + boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** GroupedResult results */ + results?: (google.cloud.vision.v1p4beta1.ProductSearchResults.IResult[]|null); + } + + /** Represents a GroupedResult. */ + class GroupedResult implements IGroupedResult { + + /** + * Constructs a new GroupedResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult); + + /** GroupedResult boundingPoly. */ + public boundingPoly?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** GroupedResult results. */ + public results: google.cloud.vision.v1p4beta1.ProductSearchResults.IResult[]; + + /** + * Creates a new GroupedResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupedResult instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult): google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult; + + /** + * Encodes the specified GroupedResult message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @param message GroupedResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupedResult message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @param message GroupedResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupedResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult; + + /** + * Decodes a GroupedResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult; + + /** + * Verifies a GroupedResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupedResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupedResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult; + + /** + * Creates a plain object from a GroupedResult message. Also converts values to other types if specified. + * @param message GroupedResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupedResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Represents a ProductSearch */ + class ProductSearch extends $protobuf.rpc.Service { + + /** + * Constructs a new ProductSearch 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 ProductSearch 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): ProductSearch; + + /** + * Calls CreateProductSet. + * @param request CreateProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public createProductSet(request: google.cloud.vision.v1p4beta1.ICreateProductSetRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.CreateProductSetCallback): void; + + /** + * Calls CreateProductSet. + * @param request CreateProductSetRequest message or plain object + * @returns Promise + */ + public createProductSet(request: google.cloud.vision.v1p4beta1.ICreateProductSetRequest): Promise; + + /** + * Calls ListProductSets. + * @param request ListProductSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductSetsResponse + */ + public listProductSets(request: google.cloud.vision.v1p4beta1.IListProductSetsRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.ListProductSetsCallback): void; + + /** + * Calls ListProductSets. + * @param request ListProductSetsRequest message or plain object + * @returns Promise + */ + public listProductSets(request: google.cloud.vision.v1p4beta1.IListProductSetsRequest): Promise; + + /** + * Calls GetProductSet. + * @param request GetProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public getProductSet(request: google.cloud.vision.v1p4beta1.IGetProductSetRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.GetProductSetCallback): void; + + /** + * Calls GetProductSet. + * @param request GetProductSetRequest message or plain object + * @returns Promise + */ + public getProductSet(request: google.cloud.vision.v1p4beta1.IGetProductSetRequest): Promise; + + /** + * Calls UpdateProductSet. + * @param request UpdateProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProductSet + */ + public updateProductSet(request: google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.UpdateProductSetCallback): void; + + /** + * Calls UpdateProductSet. + * @param request UpdateProductSetRequest message or plain object + * @returns Promise + */ + public updateProductSet(request: google.cloud.vision.v1p4beta1.IUpdateProductSetRequest): Promise; + + /** + * Calls DeleteProductSet. + * @param request DeleteProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteProductSet(request: google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.DeleteProductSetCallback): void; + + /** + * Calls DeleteProductSet. + * @param request DeleteProductSetRequest message or plain object + * @returns Promise + */ + public deleteProductSet(request: google.cloud.vision.v1p4beta1.IDeleteProductSetRequest): Promise; + + /** + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public createProduct(request: google.cloud.vision.v1p4beta1.ICreateProductRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.CreateProductCallback): void; + + /** + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @returns Promise + */ + public createProduct(request: google.cloud.vision.v1p4beta1.ICreateProductRequest): Promise; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsResponse + */ + public listProducts(request: google.cloud.vision.v1p4beta1.IListProductsRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.ListProductsCallback): void; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @returns Promise + */ + public listProducts(request: google.cloud.vision.v1p4beta1.IListProductsRequest): Promise; + + /** + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public getProduct(request: google.cloud.vision.v1p4beta1.IGetProductRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.GetProductCallback): void; + + /** + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @returns Promise + */ + public getProduct(request: google.cloud.vision.v1p4beta1.IGetProductRequest): Promise; + + /** + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product + */ + public updateProduct(request: google.cloud.vision.v1p4beta1.IUpdateProductRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.UpdateProductCallback): void; + + /** + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @returns Promise + */ + public updateProduct(request: google.cloud.vision.v1p4beta1.IUpdateProductRequest): Promise; + + /** + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteProduct(request: google.cloud.vision.v1p4beta1.IDeleteProductRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.DeleteProductCallback): void; + + /** + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object + * @returns Promise + */ + public deleteProduct(request: google.cloud.vision.v1p4beta1.IDeleteProductRequest): Promise; + + /** + * Calls CreateReferenceImage. + * @param request CreateReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReferenceImage + */ + public createReferenceImage(request: google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.CreateReferenceImageCallback): void; + + /** + * Calls CreateReferenceImage. + * @param request CreateReferenceImageRequest message or plain object + * @returns Promise + */ + public createReferenceImage(request: google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest): Promise; + + /** + * Calls DeleteReferenceImage. + * @param request DeleteReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteReferenceImage(request: google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.DeleteReferenceImageCallback): void; + + /** + * Calls DeleteReferenceImage. + * @param request DeleteReferenceImageRequest message or plain object + * @returns Promise + */ + public deleteReferenceImage(request: google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest): Promise; + + /** + * Calls ListReferenceImages. + * @param request ListReferenceImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReferenceImagesResponse + */ + public listReferenceImages(request: google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.ListReferenceImagesCallback): void; + + /** + * Calls ListReferenceImages. + * @param request ListReferenceImagesRequest message or plain object + * @returns Promise + */ + public listReferenceImages(request: google.cloud.vision.v1p4beta1.IListReferenceImagesRequest): Promise; + + /** + * Calls GetReferenceImage. + * @param request GetReferenceImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReferenceImage + */ + public getReferenceImage(request: google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.GetReferenceImageCallback): void; + + /** + * Calls GetReferenceImage. + * @param request GetReferenceImageRequest message or plain object + * @returns Promise + */ + public getReferenceImage(request: google.cloud.vision.v1p4beta1.IGetReferenceImageRequest): Promise; + + /** + * Calls AddProductToProductSet. + * @param request AddProductToProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public addProductToProductSet(request: google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.AddProductToProductSetCallback): void; + + /** + * Calls AddProductToProductSet. + * @param request AddProductToProductSetRequest message or plain object + * @returns Promise + */ + public addProductToProductSet(request: google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest): Promise; + + /** + * Calls RemoveProductFromProductSet. + * @param request RemoveProductFromProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public removeProductFromProductSet(request: google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.RemoveProductFromProductSetCallback): void; + + /** + * Calls RemoveProductFromProductSet. + * @param request RemoveProductFromProductSetRequest message or plain object + * @returns Promise + */ + public removeProductFromProductSet(request: google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest): Promise; + + /** + * Calls ListProductsInProductSet. + * @param request ListProductsInProductSetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsInProductSetResponse + */ + public listProductsInProductSet(request: google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.ListProductsInProductSetCallback): void; + + /** + * Calls ListProductsInProductSet. + * @param request ListProductsInProductSetRequest message or plain object + * @returns Promise + */ + public listProductsInProductSet(request: google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest): Promise; + + /** + * Calls ImportProductSets. + * @param request ImportProductSetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importProductSets(request: google.cloud.vision.v1p4beta1.IImportProductSetsRequest, callback: google.cloud.vision.v1p4beta1.ProductSearch.ImportProductSetsCallback): void; + + /** + * Calls ImportProductSets. + * @param request ImportProductSetsRequest message or plain object + * @returns Promise + */ + public importProductSets(request: google.cloud.vision.v1p4beta1.IImportProductSetsRequest): Promise; + } + + namespace ProductSearch { + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#createProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type CreateProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listProductSets}. + * @param error Error, if any + * @param [response] ListProductSetsResponse + */ + type ListProductSetsCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ListProductSetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#getProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type GetProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#updateProductSet}. + * @param error Error, if any + * @param [response] ProductSet + */ + type UpdateProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ProductSet) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#deleteProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#createProduct}. + * @param error Error, if any + * @param [response] Product + */ + type CreateProductCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listProducts}. + * @param error Error, if any + * @param [response] ListProductsResponse + */ + type ListProductsCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ListProductsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#getProduct}. + * @param error Error, if any + * @param [response] Product + */ + type GetProductCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#updateProduct}. + * @param error Error, if any + * @param [response] Product + */ + type UpdateProductCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.Product) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#deleteProduct}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#createReferenceImage}. + * @param error Error, if any + * @param [response] ReferenceImage + */ + type CreateReferenceImageCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ReferenceImage) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#deleteReferenceImage}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteReferenceImageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listReferenceImages}. + * @param error Error, if any + * @param [response] ListReferenceImagesResponse + */ + type ListReferenceImagesCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#getReferenceImage}. + * @param error Error, if any + * @param [response] ReferenceImage + */ + type GetReferenceImageCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ReferenceImage) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#addProductToProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type AddProductToProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#removeProductFromProductSet}. + * @param error Error, if any + * @param [response] Empty + */ + type RemoveProductFromProductSetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listProductsInProductSet}. + * @param error Error, if any + * @param [response] ListProductsInProductSetResponse + */ + type ListProductsInProductSetCallback = (error: (Error|null), response?: google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) => void; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#importProductSets}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportProductSetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Product. */ + interface IProduct { + + /** Product name */ + name?: (string|null); + + /** Product displayName */ + displayName?: (string|null); + + /** Product description */ + description?: (string|null); + + /** Product productCategory */ + productCategory?: (string|null); + + /** Product productLabels */ + productLabels?: (google.cloud.vision.v1p4beta1.Product.IKeyValue[]|null); + } + + /** Represents a Product. */ + class Product implements IProduct { + + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IProduct); + + /** Product name. */ + public name: string; + + /** Product displayName. */ + public displayName: string; + + /** Product description. */ + public description: string; + + /** Product productCategory. */ + public productCategory: string; + + /** Product productLabels. */ + public productLabels: google.cloud.vision.v1p4beta1.Product.IKeyValue[]; + + /** + * Creates a new Product instance using the specified properties. + * @param [properties] Properties to set + * @returns Product instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IProduct): google.cloud.vision.v1p4beta1.Product; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Product message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Product; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Product; + + /** + * Verifies a Product message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Product + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Product; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Product to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Product { + + /** Properties of a KeyValue. */ + interface IKeyValue { + + /** KeyValue key */ + key?: (string|null); + + /** KeyValue value */ + value?: (string|null); + } + + /** Represents a KeyValue. */ + class KeyValue implements IKeyValue { + + /** + * Constructs a new KeyValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.Product.IKeyValue); + + /** KeyValue key. */ + public key: string; + + /** KeyValue value. */ + public value: string; + + /** + * Creates a new KeyValue instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyValue instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.Product.IKeyValue): google.cloud.vision.v1p4beta1.Product.KeyValue; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.Product.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.Product.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Product.KeyValue; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Product.KeyValue; + + /** + * Verifies a KeyValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Product.KeyValue; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @param message KeyValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Product.KeyValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ProductSet. */ + interface IProductSet { + + /** ProductSet name */ + name?: (string|null); + + /** ProductSet displayName */ + displayName?: (string|null); + + /** ProductSet indexTime */ + indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSet indexError */ + indexError?: (google.rpc.IStatus|null); + } + + /** Represents a ProductSet. */ + class ProductSet implements IProductSet { + + /** + * Constructs a new ProductSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IProductSet); + + /** ProductSet name. */ + public name: string; + + /** ProductSet displayName. */ + public displayName: string; + + /** ProductSet indexTime. */ + public indexTime?: (google.protobuf.ITimestamp|null); + + /** ProductSet indexError. */ + public indexError?: (google.rpc.IStatus|null); + + /** + * Creates a new ProductSet instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductSet instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IProductSet): google.cloud.vision.v1p4beta1.ProductSet; + + /** + * Encodes the specified ProductSet message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSet.verify|verify} messages. + * @param message ProductSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IProductSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductSet message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSet.verify|verify} messages. + * @param message ProductSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IProductSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ProductSet; + + /** + * Decodes a ProductSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ProductSet; + + /** + * Verifies a ProductSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ProductSet; + + /** + * Creates a plain object from a ProductSet message. Also converts values to other types if specified. + * @param message ProductSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ProductSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReferenceImage. */ + interface IReferenceImage { + + /** ReferenceImage name */ + name?: (string|null); + + /** ReferenceImage uri */ + uri?: (string|null); + + /** ReferenceImage boundingPolys */ + boundingPolys?: (google.cloud.vision.v1p4beta1.IBoundingPoly[]|null); + } + + /** Represents a ReferenceImage. */ + class ReferenceImage implements IReferenceImage { + + /** + * Constructs a new ReferenceImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IReferenceImage); + + /** ReferenceImage name. */ + public name: string; + + /** ReferenceImage uri. */ + public uri: string; + + /** ReferenceImage boundingPolys. */ + public boundingPolys: google.cloud.vision.v1p4beta1.IBoundingPoly[]; + + /** + * Creates a new ReferenceImage instance using the specified properties. + * @param [properties] Properties to set + * @returns ReferenceImage instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IReferenceImage): google.cloud.vision.v1p4beta1.ReferenceImage; + + /** + * Encodes the specified ReferenceImage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ReferenceImage.verify|verify} messages. + * @param message ReferenceImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IReferenceImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReferenceImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ReferenceImage.verify|verify} messages. + * @param message ReferenceImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IReferenceImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ReferenceImage; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ReferenceImage; + + /** + * Verifies a ReferenceImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReferenceImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReferenceImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ReferenceImage; + + /** + * Creates a plain object from a ReferenceImage message. Also converts values to other types if specified. + * @param message ReferenceImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ReferenceImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReferenceImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateProductRequest. */ + interface ICreateProductRequest { + + /** CreateProductRequest parent */ + parent?: (string|null); + + /** CreateProductRequest product */ + product?: (google.cloud.vision.v1p4beta1.IProduct|null); + + /** CreateProductRequest productId */ + productId?: (string|null); + } + + /** Represents a CreateProductRequest. */ + class CreateProductRequest implements ICreateProductRequest { + + /** + * Constructs a new CreateProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ICreateProductRequest); + + /** CreateProductRequest parent. */ + public parent: string; + + /** CreateProductRequest product. */ + public product?: (google.cloud.vision.v1p4beta1.IProduct|null); + + /** CreateProductRequest productId. */ + public productId: string; + + /** + * Creates a new CreateProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ICreateProductRequest): google.cloud.vision.v1p4beta1.CreateProductRequest; + + /** + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.CreateProductRequest; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.CreateProductRequest; + + /** + * Verifies a CreateProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.CreateProductRequest; + + /** + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @param message CreateProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsRequest. */ + interface IListProductsRequest { + + /** ListProductsRequest parent */ + parent?: (string|null); + + /** ListProductsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductsRequest. */ + class ListProductsRequest implements IListProductsRequest { + + /** + * Constructs a new ListProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListProductsRequest); + + /** ListProductsRequest parent. */ + public parent: string; + + /** ListProductsRequest pageSize. */ + public pageSize: number; + + /** ListProductsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListProductsRequest): google.cloud.vision.v1p4beta1.ListProductsRequest; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListProductsRequest; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListProductsRequest; + + /** + * Verifies a ListProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListProductsRequest; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @param message ListProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsResponse. */ + interface IListProductsResponse { + + /** ListProductsResponse products */ + products?: (google.cloud.vision.v1p4beta1.IProduct[]|null); + + /** ListProductsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsResponse. */ + class ListProductsResponse implements IListProductsResponse { + + /** + * Constructs a new ListProductsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListProductsResponse); + + /** ListProductsResponse products. */ + public products: google.cloud.vision.v1p4beta1.IProduct[]; + + /** ListProductsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListProductsResponse): google.cloud.vision.v1p4beta1.ListProductsResponse; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListProductsResponse; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListProductsResponse; + + /** + * Verifies a ListProductsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListProductsResponse; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @param message ListProductsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetProductRequest. */ + interface IGetProductRequest { + + /** GetProductRequest name */ + name?: (string|null); + } + + /** Represents a GetProductRequest. */ + class GetProductRequest implements IGetProductRequest { + + /** + * Constructs a new GetProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IGetProductRequest); + + /** GetProductRequest name. */ + public name: string; + + /** + * Creates a new GetProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IGetProductRequest): google.cloud.vision.v1p4beta1.GetProductRequest; + + /** + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.GetProductRequest; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.GetProductRequest; + + /** + * Verifies a GetProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.GetProductRequest; + + /** + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @param message GetProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateProductRequest. */ + interface IUpdateProductRequest { + + /** UpdateProductRequest product */ + product?: (google.cloud.vision.v1p4beta1.IProduct|null); + + /** UpdateProductRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProductRequest. */ + class UpdateProductRequest implements IUpdateProductRequest { + + /** + * Constructs a new UpdateProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IUpdateProductRequest); + + /** UpdateProductRequest product. */ + public product?: (google.cloud.vision.v1p4beta1.IProduct|null); + + /** UpdateProductRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IUpdateProductRequest): google.cloud.vision.v1p4beta1.UpdateProductRequest; + + /** + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.UpdateProductRequest; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.UpdateProductRequest; + + /** + * Verifies an UpdateProductRequest message. + * @param message Plain 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.UpdateProductRequest; + + /** + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @param message UpdateProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteProductRequest. */ + interface IDeleteProductRequest { + + /** DeleteProductRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProductRequest. */ + class DeleteProductRequest implements IDeleteProductRequest { + + /** + * Constructs a new DeleteProductRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IDeleteProductRequest); + + /** DeleteProductRequest name. */ + public name: string; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProductRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IDeleteProductRequest): google.cloud.vision.v1p4beta1.DeleteProductRequest; + + /** + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.DeleteProductRequest; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.DeleteProductRequest; + + /** + * Verifies a DeleteProductRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProductRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.DeleteProductRequest; + + /** + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @param message DeleteProductRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProductRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateProductSetRequest. */ + interface ICreateProductSetRequest { + + /** CreateProductSetRequest parent */ + parent?: (string|null); + + /** CreateProductSetRequest productSet */ + productSet?: (google.cloud.vision.v1p4beta1.IProductSet|null); + + /** CreateProductSetRequest productSetId */ + productSetId?: (string|null); + } + + /** Represents a CreateProductSetRequest. */ + class CreateProductSetRequest implements ICreateProductSetRequest { + + /** + * Constructs a new CreateProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ICreateProductSetRequest); + + /** CreateProductSetRequest parent. */ + public parent: string; + + /** CreateProductSetRequest productSet. */ + public productSet?: (google.cloud.vision.v1p4beta1.IProductSet|null); + + /** CreateProductSetRequest productSetId. */ + public productSetId: string; + + /** + * Creates a new CreateProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ICreateProductSetRequest): google.cloud.vision.v1p4beta1.CreateProductSetRequest; + + /** + * Encodes the specified CreateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductSetRequest.verify|verify} messages. + * @param message CreateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ICreateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductSetRequest.verify|verify} messages. + * @param message CreateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ICreateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.CreateProductSetRequest; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.CreateProductSetRequest; + + /** + * Verifies a CreateProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.CreateProductSetRequest; + + /** + * Creates a plain object from a CreateProductSetRequest message. Also converts values to other types if specified. + * @param message CreateProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.CreateProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductSetsRequest. */ + interface IListProductSetsRequest { + + /** ListProductSetsRequest parent */ + parent?: (string|null); + + /** ListProductSetsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductSetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductSetsRequest. */ + class ListProductSetsRequest implements IListProductSetsRequest { + + /** + * Constructs a new ListProductSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListProductSetsRequest); + + /** ListProductSetsRequest parent. */ + public parent: string; + + /** ListProductSetsRequest pageSize. */ + public pageSize: number; + + /** ListProductSetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductSetsRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListProductSetsRequest): google.cloud.vision.v1p4beta1.ListProductSetsRequest; + + /** + * Encodes the specified ListProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsRequest.verify|verify} messages. + * @param message ListProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsRequest.verify|verify} messages. + * @param message ListProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListProductSetsRequest; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListProductSetsRequest; + + /** + * Verifies a ListProductSetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListProductSetsRequest; + + /** + * Creates a plain object from a ListProductSetsRequest message. Also converts values to other types if specified. + * @param message ListProductSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListProductSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductSetsResponse. */ + interface IListProductSetsResponse { + + /** ListProductSetsResponse productSets */ + productSets?: (google.cloud.vision.v1p4beta1.IProductSet[]|null); + + /** ListProductSetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductSetsResponse. */ + class ListProductSetsResponse implements IListProductSetsResponse { + + /** + * Constructs a new ListProductSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListProductSetsResponse); + + /** ListProductSetsResponse productSets. */ + public productSets: google.cloud.vision.v1p4beta1.IProductSet[]; + + /** ListProductSetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductSetsResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListProductSetsResponse): google.cloud.vision.v1p4beta1.ListProductSetsResponse; + + /** + * Encodes the specified ListProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsResponse.verify|verify} messages. + * @param message ListProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsResponse.verify|verify} messages. + * @param message ListProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListProductSetsResponse; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListProductSetsResponse; + + /** + * Verifies a ListProductSetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListProductSetsResponse; + + /** + * Creates a plain object from a ListProductSetsResponse message. Also converts values to other types if specified. + * @param message ListProductSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListProductSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetProductSetRequest. */ + interface IGetProductSetRequest { + + /** GetProductSetRequest name */ + name?: (string|null); + } + + /** Represents a GetProductSetRequest. */ + class GetProductSetRequest implements IGetProductSetRequest { + + /** + * Constructs a new GetProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IGetProductSetRequest); + + /** GetProductSetRequest name. */ + public name: string; + + /** + * Creates a new GetProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IGetProductSetRequest): google.cloud.vision.v1p4beta1.GetProductSetRequest; + + /** + * Encodes the specified GetProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductSetRequest.verify|verify} messages. + * @param message GetProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IGetProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductSetRequest.verify|verify} messages. + * @param message GetProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IGetProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.GetProductSetRequest; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.GetProductSetRequest; + + /** + * Verifies a GetProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.GetProductSetRequest; + + /** + * Creates a plain object from a GetProductSetRequest message. Also converts values to other types if specified. + * @param message GetProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.GetProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateProductSetRequest. */ + interface IUpdateProductSetRequest { + + /** UpdateProductSetRequest productSet */ + productSet?: (google.cloud.vision.v1p4beta1.IProductSet|null); + + /** UpdateProductSetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProductSetRequest. */ + class UpdateProductSetRequest implements IUpdateProductSetRequest { + + /** + * Constructs a new UpdateProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IUpdateProductSetRequest); + + /** UpdateProductSetRequest productSet. */ + public productSet?: (google.cloud.vision.v1p4beta1.IProductSet|null); + + /** UpdateProductSetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IUpdateProductSetRequest): google.cloud.vision.v1p4beta1.UpdateProductSetRequest; + + /** + * Encodes the specified UpdateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductSetRequest.verify|verify} messages. + * @param message UpdateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductSetRequest.verify|verify} messages. + * @param message UpdateProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IUpdateProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.UpdateProductSetRequest; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.UpdateProductSetRequest; + + /** + * Verifies an UpdateProductSetRequest message. + * @param message Plain 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 UpdateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.UpdateProductSetRequest; + + /** + * Creates a plain object from an UpdateProductSetRequest message. Also converts values to other types if specified. + * @param message UpdateProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.UpdateProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteProductSetRequest. */ + interface IDeleteProductSetRequest { + + /** DeleteProductSetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProductSetRequest. */ + class DeleteProductSetRequest implements IDeleteProductSetRequest { + + /** + * Constructs a new DeleteProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IDeleteProductSetRequest); + + /** DeleteProductSetRequest name. */ + public name: string; + + /** + * Creates a new DeleteProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IDeleteProductSetRequest): google.cloud.vision.v1p4beta1.DeleteProductSetRequest; + + /** + * Encodes the specified DeleteProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductSetRequest.verify|verify} messages. + * @param message DeleteProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductSetRequest.verify|verify} messages. + * @param message DeleteProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IDeleteProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.DeleteProductSetRequest; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.DeleteProductSetRequest; + + /** + * Verifies a DeleteProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.DeleteProductSetRequest; + + /** + * Creates a plain object from a DeleteProductSetRequest message. Also converts values to other types if specified. + * @param message DeleteProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.DeleteProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateReferenceImageRequest. */ + interface ICreateReferenceImageRequest { + + /** CreateReferenceImageRequest parent */ + parent?: (string|null); + + /** CreateReferenceImageRequest referenceImage */ + referenceImage?: (google.cloud.vision.v1p4beta1.IReferenceImage|null); + + /** CreateReferenceImageRequest referenceImageId */ + referenceImageId?: (string|null); + } + + /** Represents a CreateReferenceImageRequest. */ + class CreateReferenceImageRequest implements ICreateReferenceImageRequest { + + /** + * Constructs a new CreateReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest); + + /** CreateReferenceImageRequest parent. */ + public parent: string; + + /** CreateReferenceImageRequest referenceImage. */ + public referenceImage?: (google.cloud.vision.v1p4beta1.IReferenceImage|null); + + /** CreateReferenceImageRequest referenceImageId. */ + public referenceImageId: string; + + /** + * Creates a new CreateReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest): google.cloud.vision.v1p4beta1.CreateReferenceImageRequest; + + /** + * Encodes the specified CreateReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.verify|verify} messages. + * @param message CreateReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.verify|verify} messages. + * @param message CreateReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.CreateReferenceImageRequest; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.CreateReferenceImageRequest; + + /** + * Verifies a CreateReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.CreateReferenceImageRequest; + + /** + * Creates a plain object from a CreateReferenceImageRequest message. Also converts values to other types if specified. + * @param message CreateReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReferenceImagesRequest. */ + interface IListReferenceImagesRequest { + + /** ListReferenceImagesRequest parent */ + parent?: (string|null); + + /** ListReferenceImagesRequest pageSize */ + pageSize?: (number|null); + + /** ListReferenceImagesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListReferenceImagesRequest. */ + class ListReferenceImagesRequest implements IListReferenceImagesRequest { + + /** + * Constructs a new ListReferenceImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListReferenceImagesRequest); + + /** ListReferenceImagesRequest parent. */ + public parent: string; + + /** ListReferenceImagesRequest pageSize. */ + public pageSize: number; + + /** ListReferenceImagesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListReferenceImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReferenceImagesRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListReferenceImagesRequest): google.cloud.vision.v1p4beta1.ListReferenceImagesRequest; + + /** + * Encodes the specified ListReferenceImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.verify|verify} messages. + * @param message ListReferenceImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReferenceImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.verify|verify} messages. + * @param message ListReferenceImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListReferenceImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListReferenceImagesRequest; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListReferenceImagesRequest; + + /** + * Verifies a ListReferenceImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReferenceImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReferenceImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListReferenceImagesRequest; + + /** + * Creates a plain object from a ListReferenceImagesRequest message. Also converts values to other types if specified. + * @param message ListReferenceImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReferenceImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReferenceImagesResponse. */ + interface IListReferenceImagesResponse { + + /** ListReferenceImagesResponse referenceImages */ + referenceImages?: (google.cloud.vision.v1p4beta1.IReferenceImage[]|null); + + /** ListReferenceImagesResponse pageSize */ + pageSize?: (number|null); + + /** ListReferenceImagesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReferenceImagesResponse. */ + class ListReferenceImagesResponse implements IListReferenceImagesResponse { + + /** + * Constructs a new ListReferenceImagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListReferenceImagesResponse); + + /** ListReferenceImagesResponse referenceImages. */ + public referenceImages: google.cloud.vision.v1p4beta1.IReferenceImage[]; + + /** ListReferenceImagesResponse pageSize. */ + public pageSize: number; + + /** ListReferenceImagesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReferenceImagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReferenceImagesResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListReferenceImagesResponse): google.cloud.vision.v1p4beta1.ListReferenceImagesResponse; + + /** + * Encodes the specified ListReferenceImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.verify|verify} messages. + * @param message ListReferenceImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListReferenceImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReferenceImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.verify|verify} messages. + * @param message ListReferenceImagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListReferenceImagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListReferenceImagesResponse; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListReferenceImagesResponse; + + /** + * Verifies a ListReferenceImagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReferenceImagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReferenceImagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListReferenceImagesResponse; + + /** + * Creates a plain object from a ListReferenceImagesResponse message. Also converts values to other types if specified. + * @param message ListReferenceImagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListReferenceImagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReferenceImagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetReferenceImageRequest. */ + interface IGetReferenceImageRequest { + + /** GetReferenceImageRequest name */ + name?: (string|null); + } + + /** Represents a GetReferenceImageRequest. */ + class GetReferenceImageRequest implements IGetReferenceImageRequest { + + /** + * Constructs a new GetReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IGetReferenceImageRequest); + + /** GetReferenceImageRequest name. */ + public name: string; + + /** + * Creates a new GetReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IGetReferenceImageRequest): google.cloud.vision.v1p4beta1.GetReferenceImageRequest; + + /** + * Encodes the specified GetReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetReferenceImageRequest.verify|verify} messages. + * @param message GetReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetReferenceImageRequest.verify|verify} messages. + * @param message GetReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IGetReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.GetReferenceImageRequest; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.GetReferenceImageRequest; + + /** + * Verifies a GetReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.GetReferenceImageRequest; + + /** + * Creates a plain object from a GetReferenceImageRequest message. Also converts values to other types if specified. + * @param message GetReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.GetReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteReferenceImageRequest. */ + interface IDeleteReferenceImageRequest { + + /** DeleteReferenceImageRequest name */ + name?: (string|null); + } + + /** Represents a DeleteReferenceImageRequest. */ + class DeleteReferenceImageRequest implements IDeleteReferenceImageRequest { + + /** + * Constructs a new DeleteReferenceImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest); + + /** DeleteReferenceImageRequest name. */ + public name: string; + + /** + * Creates a new DeleteReferenceImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReferenceImageRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest): google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest; + + /** + * Encodes the specified DeleteReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @param message DeleteReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @param message DeleteReferenceImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest; + + /** + * Verifies a DeleteReferenceImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReferenceImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest; + + /** + * Creates a plain object from a DeleteReferenceImageRequest message. Also converts values to other types if specified. + * @param message DeleteReferenceImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteReferenceImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddProductToProductSetRequest. */ + interface IAddProductToProductSetRequest { + + /** AddProductToProductSetRequest name */ + name?: (string|null); + + /** AddProductToProductSetRequest product */ + product?: (string|null); + } + + /** Represents an AddProductToProductSetRequest. */ + class AddProductToProductSetRequest implements IAddProductToProductSetRequest { + + /** + * Constructs a new AddProductToProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest); + + /** AddProductToProductSetRequest name. */ + public name: string; + + /** AddProductToProductSetRequest product. */ + public product: string; + + /** + * Creates a new AddProductToProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddProductToProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest): google.cloud.vision.v1p4beta1.AddProductToProductSetRequest; + + /** + * Encodes the specified AddProductToProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.verify|verify} messages. + * @param message AddProductToProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddProductToProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.verify|verify} messages. + * @param message AddProductToProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.AddProductToProductSetRequest; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.AddProductToProductSetRequest; + + /** + * Verifies an AddProductToProductSetRequest message. + * @param message Plain 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 AddProductToProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddProductToProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.AddProductToProductSetRequest; + + /** + * Creates a plain object from an AddProductToProductSetRequest message. Also converts values to other types if specified. + * @param message AddProductToProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddProductToProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveProductFromProductSetRequest. */ + interface IRemoveProductFromProductSetRequest { + + /** RemoveProductFromProductSetRequest name */ + name?: (string|null); + + /** RemoveProductFromProductSetRequest product */ + product?: (string|null); + } + + /** Represents a RemoveProductFromProductSetRequest. */ + class RemoveProductFromProductSetRequest implements IRemoveProductFromProductSetRequest { + + /** + * Constructs a new RemoveProductFromProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest); + + /** RemoveProductFromProductSetRequest name. */ + public name: string; + + /** RemoveProductFromProductSetRequest product. */ + public product: string; + + /** + * Creates a new RemoveProductFromProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveProductFromProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest): google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @param message RemoveProductFromProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @param message RemoveProductFromProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest; + + /** + * Verifies a RemoveProductFromProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveProductFromProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveProductFromProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest; + + /** + * Creates a plain object from a RemoveProductFromProductSetRequest message. Also converts values to other types if specified. + * @param message RemoveProductFromProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveProductFromProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsInProductSetRequest. */ + interface IListProductsInProductSetRequest { + + /** ListProductsInProductSetRequest name */ + name?: (string|null); + + /** ListProductsInProductSetRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsInProductSetRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProductsInProductSetRequest. */ + class ListProductsInProductSetRequest implements IListProductsInProductSetRequest { + + /** + * Constructs a new ListProductsInProductSetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest); + + /** ListProductsInProductSetRequest name. */ + public name: string; + + /** ListProductsInProductSetRequest pageSize. */ + public pageSize: number; + + /** ListProductsInProductSetRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProductsInProductSetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsInProductSetRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest): google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest; + + /** + * Encodes the specified ListProductsInProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @param message ListProductsInProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsInProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @param message ListProductsInProductSetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest; + + /** + * Verifies a ListProductsInProductSetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsInProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsInProductSetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest; + + /** + * Creates a plain object from a ListProductsInProductSetRequest message. Also converts values to other types if specified. + * @param message ListProductsInProductSetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsInProductSetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListProductsInProductSetResponse. */ + interface IListProductsInProductSetResponse { + + /** ListProductsInProductSetResponse products */ + products?: (google.cloud.vision.v1p4beta1.IProduct[]|null); + + /** ListProductsInProductSetResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsInProductSetResponse. */ + class ListProductsInProductSetResponse implements IListProductsInProductSetResponse { + + /** + * Constructs a new ListProductsInProductSetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse); + + /** ListProductsInProductSetResponse products. */ + public products: google.cloud.vision.v1p4beta1.IProduct[]; + + /** ListProductsInProductSetResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductsInProductSetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsInProductSetResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse): google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse; + + /** + * Encodes the specified ListProductsInProductSetResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @param message ListProductsInProductSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsInProductSetResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @param message ListProductsInProductSetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse; + + /** + * Verifies a ListProductsInProductSetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsInProductSetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsInProductSetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse; + + /** + * Creates a plain object from a ListProductsInProductSetResponse message. Also converts values to other types if specified. + * @param message ListProductsInProductSetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsInProductSetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsGcsSource. */ + interface IImportProductSetsGcsSource { + + /** ImportProductSetsGcsSource csvFileUri */ + csvFileUri?: (string|null); + } + + /** Represents an ImportProductSetsGcsSource. */ + class ImportProductSetsGcsSource implements IImportProductSetsGcsSource { + + /** + * Constructs a new ImportProductSetsGcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource); + + /** ImportProductSetsGcsSource csvFileUri. */ + public csvFileUri: string; + + /** + * Creates a new ImportProductSetsGcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsGcsSource instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource): google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource; + + /** + * Encodes the specified ImportProductSetsGcsSource message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @param message ImportProductSetsGcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsGcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @param message ImportProductSetsGcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource; + + /** + * Verifies an ImportProductSetsGcsSource message. + * @param message Plain 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 ImportProductSetsGcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsGcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource; + + /** + * Creates a plain object from an ImportProductSetsGcsSource message. Also converts values to other types if specified. + * @param message ImportProductSetsGcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsGcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsInputConfig. */ + interface IImportProductSetsInputConfig { + + /** ImportProductSetsInputConfig gcsSource */ + gcsSource?: (google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource|null); + } + + /** Represents an ImportProductSetsInputConfig. */ + class ImportProductSetsInputConfig implements IImportProductSetsInputConfig { + + /** + * Constructs a new ImportProductSetsInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig); + + /** ImportProductSetsInputConfig gcsSource. */ + public gcsSource?: (google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource|null); + + /** ImportProductSetsInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new ImportProductSetsInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsInputConfig instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig): google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig; + + /** + * Encodes the specified ImportProductSetsInputConfig message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @param message ImportProductSetsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsInputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @param message ImportProductSetsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig; + + /** + * Verifies an ImportProductSetsInputConfig message. + * @param message Plain 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 ImportProductSetsInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig; + + /** + * Creates a plain object from an ImportProductSetsInputConfig message. Also converts values to other types if specified. + * @param message ImportProductSetsInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsRequest. */ + interface IImportProductSetsRequest { + + /** ImportProductSetsRequest parent */ + parent?: (string|null); + + /** ImportProductSetsRequest inputConfig */ + inputConfig?: (google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig|null); + } + + /** Represents an ImportProductSetsRequest. */ + class ImportProductSetsRequest implements IImportProductSetsRequest { + + /** + * Constructs a new ImportProductSetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsRequest); + + /** ImportProductSetsRequest parent. */ + public parent: string; + + /** ImportProductSetsRequest inputConfig. */ + public inputConfig?: (google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig|null); + + /** + * Creates a new ImportProductSetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsRequest instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsRequest): google.cloud.vision.v1p4beta1.ImportProductSetsRequest; + + /** + * Encodes the specified ImportProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsRequest.verify|verify} messages. + * @param message ImportProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImportProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsRequest.verify|verify} messages. + * @param message ImportProductSetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImportProductSetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImportProductSetsRequest; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImportProductSetsRequest; + + /** + * Verifies an ImportProductSetsRequest message. + * @param message Plain 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 ImportProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImportProductSetsRequest; + + /** + * Creates a plain object from an ImportProductSetsRequest message. Also converts values to other types if specified. + * @param message ImportProductSetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImportProductSetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportProductSetsResponse. */ + interface IImportProductSetsResponse { + + /** ImportProductSetsResponse referenceImages */ + referenceImages?: (google.cloud.vision.v1p4beta1.IReferenceImage[]|null); + + /** ImportProductSetsResponse statuses */ + statuses?: (google.rpc.IStatus[]|null); + } + + /** Represents an ImportProductSetsResponse. */ + class ImportProductSetsResponse implements IImportProductSetsResponse { + + /** + * Constructs a new ImportProductSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsResponse); + + /** ImportProductSetsResponse referenceImages. */ + public referenceImages: google.cloud.vision.v1p4beta1.IReferenceImage[]; + + /** ImportProductSetsResponse statuses. */ + public statuses: google.rpc.IStatus[]; + + /** + * Creates a new ImportProductSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductSetsResponse instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IImportProductSetsResponse): google.cloud.vision.v1p4beta1.ImportProductSetsResponse; + + /** + * Encodes the specified ImportProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsResponse.verify|verify} messages. + * @param message ImportProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IImportProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsResponse.verify|verify} messages. + * @param message ImportProductSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IImportProductSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.ImportProductSetsResponse; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.ImportProductSetsResponse; + + /** + * Verifies an ImportProductSetsResponse message. + * @param message Plain 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 ImportProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.ImportProductSetsResponse; + + /** + * Creates a plain object from an ImportProductSetsResponse message. Also converts values to other types if specified. + * @param message ImportProductSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.ImportProductSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProductSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchOperationMetadata. */ + interface IBatchOperationMetadata { + + /** BatchOperationMetadata state */ + state?: (google.cloud.vision.v1p4beta1.BatchOperationMetadata.State|null); + + /** BatchOperationMetadata submitTime */ + submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BatchOperationMetadata. */ + class BatchOperationMetadata implements IBatchOperationMetadata { + + /** + * Constructs a new BatchOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IBatchOperationMetadata); + + /** BatchOperationMetadata state. */ + public state: google.cloud.vision.v1p4beta1.BatchOperationMetadata.State; + + /** BatchOperationMetadata submitTime. */ + public submitTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOperationMetadata instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IBatchOperationMetadata): google.cloud.vision.v1p4beta1.BatchOperationMetadata; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.BatchOperationMetadata; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.BatchOperationMetadata; + + /** + * Verifies a BatchOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.BatchOperationMetadata; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @param message BatchOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.BatchOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROCESSING = 1, + SUCCESSFUL = 2, + FAILED = 3, + CANCELLED = 4 + } + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation pages */ + pages?: (google.cloud.vision.v1p4beta1.IPage[]|null); + + /** TextAnnotation text */ + text?: (string|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ITextAnnotation); + + /** TextAnnotation pages. */ + public pages: google.cloud.vision.v1p4beta1.IPage[]; + + /** TextAnnotation text. */ + public text: string; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ITextAnnotation): google.cloud.vision.v1p4beta1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TextAnnotation { + + /** Properties of a DetectedLanguage. */ + interface IDetectedLanguage { + + /** DetectedLanguage languageCode */ + languageCode?: (string|null); + + /** DetectedLanguage confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLanguage. */ + class DetectedLanguage implements IDetectedLanguage { + + /** + * Constructs a new DetectedLanguage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage); + + /** DetectedLanguage languageCode. */ + public languageCode: string; + + /** DetectedLanguage confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLanguage instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @param message DetectedLanguage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage; + + /** + * Verifies a DetectedLanguage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLanguage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @param message DetectedLanguage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLanguage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectedBreak. */ + interface IDetectedBreak { + + /** DetectedBreak type */ + type?: (google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType|null); + + /** DetectedBreak isPrefix */ + isPrefix?: (boolean|null); + } + + /** Represents a DetectedBreak. */ + class DetectedBreak implements IDetectedBreak { + + /** + * Constructs a new DetectedBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak); + + /** DetectedBreak type. */ + public type: google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType; + + /** DetectedBreak isPrefix. */ + public isPrefix: boolean; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedBreak instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @param message DetectedBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak; + + /** + * Verifies a DetectedBreak message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedBreak + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @param message DetectedBreak + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DetectedBreak { + + /** BreakType enum. */ + enum BreakType { + UNKNOWN = 0, + SPACE = 1, + SURE_SPACE = 2, + EOL_SURE_SPACE = 3, + HYPHEN = 4, + LINE_BREAK = 5 + } + } + + /** Properties of a TextProperty. */ + interface ITextProperty { + + /** TextProperty detectedLanguages */ + detectedLanguages?: (google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage[]|null); + + /** TextProperty detectedBreak */ + detectedBreak?: (google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak|null); + } + + /** Represents a TextProperty. */ + class TextProperty implements ITextProperty { + + /** + * Constructs a new TextProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty); + + /** TextProperty detectedLanguages. */ + public detectedLanguages: google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage[]; + + /** TextProperty detectedBreak. */ + public detectedBreak?: (google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak|null); + + /** + * Creates a new TextProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns TextProperty instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty): google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @param message TextProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty; + + /** + * Verifies a TextProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @param message TextProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Page. */ + interface IPage { + + /** Page property */ + property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Page width */ + width?: (number|null); + + /** Page height */ + height?: (number|null); + + /** Page blocks */ + blocks?: (google.cloud.vision.v1p4beta1.IBlock[]|null); + + /** Page confidence */ + confidence?: (number|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IPage); + + /** Page property. */ + public property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Page width. */ + public width: number; + + /** Page height. */ + public height: number; + + /** Page blocks. */ + public blocks: google.cloud.vision.v1p4beta1.IBlock[]; + + /** Page confidence. */ + public confidence: number; + + /** + * Creates a new Page instance using the specified properties. + * @param [properties] Properties to set + * @returns Page instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IPage): google.cloud.vision.v1p4beta1.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Page.verify|verify} messages. + * @param message Page message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Page message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Page; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Page; + + /** + * Verifies a Page message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Page + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Page; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @param message Page + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Page, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Page to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Block. */ + interface IBlock { + + /** Block property */ + property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox */ + boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Block paragraphs */ + paragraphs?: (google.cloud.vision.v1p4beta1.IParagraph[]|null); + + /** Block blockType */ + blockType?: (google.cloud.vision.v1p4beta1.Block.BlockType|null); + + /** Block confidence */ + confidence?: (number|null); + } + + /** Represents a Block. */ + class Block implements IBlock { + + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IBlock); + + /** Block property. */ + public property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Block boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Block paragraphs. */ + public paragraphs: google.cloud.vision.v1p4beta1.IParagraph[]; + + /** Block blockType. */ + public blockType: google.cloud.vision.v1p4beta1.Block.BlockType; + + /** Block confidence. */ + public confidence: number; + + /** + * Creates a new Block instance using the specified properties. + * @param [properties] Properties to set + * @returns Block instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IBlock): google.cloud.vision.v1p4beta1.Block; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Block.verify|verify} messages. + * @param message Block message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Block message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Block; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Block; + + /** + * Verifies a Block message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Block + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Block; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @param message Block + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Block to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Block { + + /** BlockType enum. */ + enum BlockType { + UNKNOWN = 0, + TEXT = 1, + TABLE = 2, + PICTURE = 3, + RULER = 4, + BARCODE = 5 + } + } + + /** Properties of a Paragraph. */ + interface IParagraph { + + /** Paragraph property */ + property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox */ + boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Paragraph words */ + words?: (google.cloud.vision.v1p4beta1.IWord[]|null); + + /** Paragraph confidence */ + confidence?: (number|null); + } + + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { + + /** + * Constructs a new Paragraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IParagraph); + + /** Paragraph property. */ + public property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Paragraph boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Paragraph words. */ + public words: google.cloud.vision.v1p4beta1.IWord[]; + + /** Paragraph confidence. */ + public confidence: number; + + /** + * Creates a new Paragraph instance using the specified properties. + * @param [properties] Properties to set + * @returns Paragraph instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IParagraph): google.cloud.vision.v1p4beta1.Paragraph; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Paragraph.verify|verify} messages. + * @param message Paragraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Paragraph; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Paragraph; + + /** + * Verifies a Paragraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Paragraph + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Paragraph; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @param message Paragraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Paragraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Paragraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Word. */ + interface IWord { + + /** Word property */ + property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox */ + boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Word symbols */ + symbols?: (google.cloud.vision.v1p4beta1.ISymbol[]|null); + + /** Word confidence */ + confidence?: (number|null); + } + + /** Represents a Word. */ + class Word implements IWord { + + /** + * Constructs a new Word. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IWord); + + /** Word property. */ + public property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Word boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Word symbols. */ + public symbols: google.cloud.vision.v1p4beta1.ISymbol[]; + + /** Word confidence. */ + public confidence: number; + + /** + * Creates a new Word instance using the specified properties. + * @param [properties] Properties to set + * @returns Word instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IWord): google.cloud.vision.v1p4beta1.Word; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Word.verify|verify} messages. + * @param message Word message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IWord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Word message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Word; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Word; + + /** + * Verifies a Word message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Word + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Word; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @param message Word + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Word, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Word to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Symbol. */ + interface ISymbol { + + /** Symbol property */ + property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox */ + boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Symbol text */ + text?: (string|null); + + /** Symbol confidence */ + confidence?: (number|null); + } + + /** Represents a Symbol. */ + class Symbol implements ISymbol { + + /** + * Constructs a new Symbol. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.ISymbol); + + /** Symbol property. */ + public property?: (google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null); + + /** Symbol boundingBox. */ + public boundingBox?: (google.cloud.vision.v1p4beta1.IBoundingPoly|null); + + /** Symbol text. */ + public text: string; + + /** Symbol confidence. */ + public confidence: number; + + /** + * Creates a new Symbol instance using the specified properties. + * @param [properties] Properties to set + * @returns Symbol instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.ISymbol): google.cloud.vision.v1p4beta1.Symbol; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Symbol.verify|verify} messages. + * @param message Symbol message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.Symbol; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.Symbol; + + /** + * Verifies a Symbol message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Symbol + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.Symbol; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @param message Symbol + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.Symbol, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Symbol to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebDetection. */ + interface IWebDetection { + + /** WebDetection webEntities */ + webEntities?: (google.cloud.vision.v1p4beta1.WebDetection.IWebEntity[]|null); + + /** WebDetection fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]|null); + + /** WebDetection partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]|null); + + /** WebDetection pagesWithMatchingImages */ + pagesWithMatchingImages?: (google.cloud.vision.v1p4beta1.WebDetection.IWebPage[]|null); + + /** WebDetection visuallySimilarImages */ + visuallySimilarImages?: (google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]|null); + + /** WebDetection bestGuessLabels */ + bestGuessLabels?: (google.cloud.vision.v1p4beta1.WebDetection.IWebLabel[]|null); + } + + /** Represents a WebDetection. */ + class WebDetection implements IWebDetection { + + /** + * Constructs a new WebDetection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.IWebDetection); + + /** WebDetection webEntities. */ + public webEntities: google.cloud.vision.v1p4beta1.WebDetection.IWebEntity[]; + + /** WebDetection fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]; + + /** WebDetection partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]; + + /** WebDetection pagesWithMatchingImages. */ + public pagesWithMatchingImages: google.cloud.vision.v1p4beta1.WebDetection.IWebPage[]; + + /** WebDetection visuallySimilarImages. */ + public visuallySimilarImages: google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]; + + /** WebDetection bestGuessLabels. */ + public bestGuessLabels: google.cloud.vision.v1p4beta1.WebDetection.IWebLabel[]; + + /** + * Creates a new WebDetection instance using the specified properties. + * @param [properties] Properties to set + * @returns WebDetection instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.IWebDetection): google.cloud.vision.v1p4beta1.WebDetection; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.verify|verify} messages. + * @param message WebDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.IWebDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.WebDetection; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.WebDetection; + + /** + * Verifies a WebDetection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebDetection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.WebDetection; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @param message WebDetection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.WebDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebDetection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace WebDetection { + + /** Properties of a WebEntity. */ + interface IWebEntity { + + /** WebEntity entityId */ + entityId?: (string|null); + + /** WebEntity score */ + score?: (number|null); + + /** WebEntity description */ + description?: (string|null); + } + + /** Represents a WebEntity. */ + class WebEntity implements IWebEntity { + + /** + * Constructs a new WebEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebEntity); + + /** WebEntity entityId. */ + public entityId: string; + + /** WebEntity score. */ + public score: number; + + /** WebEntity description. */ + public description: string; + + /** + * Creates a new WebEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns WebEntity instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebEntity): google.cloud.vision.v1p4beta1.WebDetection.WebEntity; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebEntity.verify|verify} messages. + * @param message WebEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.WebDetection.IWebEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.WebDetection.WebEntity; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.WebDetection.WebEntity; + + /** + * Verifies a WebEntity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.WebDetection.WebEntity; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @param message WebEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.WebDetection.WebEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebImage. */ + interface IWebImage { + + /** WebImage url */ + url?: (string|null); + + /** WebImage score */ + score?: (number|null); + } + + /** Represents a WebImage. */ + class WebImage implements IWebImage { + + /** + * Constructs a new WebImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebImage); + + /** WebImage url. */ + public url: string; + + /** WebImage score. */ + public score: number; + + /** + * Creates a new WebImage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebImage instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebImage): google.cloud.vision.v1p4beta1.WebDetection.WebImage; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify|verify} messages. + * @param message WebImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.WebDetection.IWebImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.WebDetection.WebImage; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.WebDetection.WebImage; + + /** + * Verifies a WebImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebImage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.WebDetection.WebImage; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @param message WebImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.WebDetection.WebImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebLabel. */ + interface IWebLabel { + + /** WebLabel label */ + label?: (string|null); + + /** WebLabel languageCode */ + languageCode?: (string|null); + } + + /** Represents a WebLabel. */ + class WebLabel implements IWebLabel { + + /** + * Constructs a new WebLabel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebLabel); + + /** WebLabel label. */ + public label: string; + + /** WebLabel languageCode. */ + public languageCode: string; + + /** + * Creates a new WebLabel instance using the specified properties. + * @param [properties] Properties to set + * @returns WebLabel instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebLabel): google.cloud.vision.v1p4beta1.WebDetection.WebLabel; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebLabel.verify|verify} messages. + * @param message WebLabel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.WebDetection.IWebLabel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.WebDetection.WebLabel; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.WebDetection.WebLabel; + + /** + * Verifies a WebLabel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebLabel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.WebDetection.WebLabel; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @param message WebLabel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.WebDetection.WebLabel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebLabel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebPage. */ + interface IWebPage { + + /** WebPage url */ + url?: (string|null); + + /** WebPage score */ + score?: (number|null); + + /** WebPage pageTitle */ + pageTitle?: (string|null); + + /** WebPage fullMatchingImages */ + fullMatchingImages?: (google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]|null); + + /** WebPage partialMatchingImages */ + partialMatchingImages?: (google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]|null); + } + + /** Represents a WebPage. */ + class WebPage implements IWebPage { + + /** + * Constructs a new WebPage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebPage); + + /** WebPage url. */ + public url: string; + + /** WebPage score. */ + public score: number; + + /** WebPage pageTitle. */ + public pageTitle: string; + + /** WebPage fullMatchingImages. */ + public fullMatchingImages: google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]; + + /** WebPage partialMatchingImages. */ + public partialMatchingImages: google.cloud.vision.v1p4beta1.WebDetection.IWebImage[]; + + /** + * Creates a new WebPage instance using the specified properties. + * @param [properties] Properties to set + * @returns WebPage instance + */ + public static create(properties?: google.cloud.vision.v1p4beta1.WebDetection.IWebPage): google.cloud.vision.v1p4beta1.WebDetection.WebPage; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vision.v1p4beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebPage.verify|verify} messages. + * @param message WebPage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vision.v1p4beta1.WebDetection.IWebPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vision.v1p4beta1.WebDetection.WebPage; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vision.v1p4beta1.WebDetection.WebPage; + + /** + * Verifies a WebPage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebPage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vision.v1p4beta1.WebDetection.WebPage; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @param message WebPage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vision.v1p4beta1.WebDetection.WebPage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebPage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not 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.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload 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.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get: string; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not 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.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload 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.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not 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.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload 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.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + 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 + } + + /** 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 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 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 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 ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not 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.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload 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.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not 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.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload 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.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not 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.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload 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.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not 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.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload 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.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not 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.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload 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.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not 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.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload 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.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: google.protobuf.FieldDescriptorProto.Label; + + /** FieldDescriptorProto type. */ + public type: google.protobuf.FieldDescriptorProto.Type; + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not 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.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload 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.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not 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.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload 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.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not 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.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload 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.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not 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.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload 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.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not 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.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload 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.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not 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.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload 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.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not 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.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload 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.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not 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.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload 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.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not 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.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload 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.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: google.protobuf.FieldOptions.CType; + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: google.protobuf.FieldOptions.JSType; + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not 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.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload 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.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not 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.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload 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.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not 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.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload 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.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not 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.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload 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.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not 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.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload 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.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not 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.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload 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.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not 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.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload 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.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not 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.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload 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.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not 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.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload 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.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not 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.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload 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.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not 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.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload 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.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: Uint8Array; + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not 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.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload 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.Any; + + /** + * Verifies an Any message. + * @param message Plain 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not 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.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload 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.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not 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.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload 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.Empty; + + /** + * Verifies an Empty message. + * @param message Plain 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 Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not 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.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload 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.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask 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 + */ + 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 a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not 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.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload 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.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not 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.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload 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.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not 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.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload 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.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain 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 Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not 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.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload 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.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not 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.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload 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.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain 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 Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not 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.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload 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.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not 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.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload 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.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not 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.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload 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.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations 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 Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain 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 Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain 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 OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + 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 }; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Color. */ + interface IColor { + + /** Color red */ + red?: (number|null); + + /** Color green */ + green?: (number|null); + + /** Color blue */ + blue?: (number|null); + + /** Color alpha */ + alpha?: (google.protobuf.IFloatValue|null); + } + + /** Represents a Color. */ + class Color implements IColor { + + /** + * Constructs a new Color. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IColor); + + /** Color red. */ + public red: number; + + /** Color green. */ + public green: number; + + /** Color blue. */ + public blue: number; + + /** Color alpha. */ + public alpha?: (google.protobuf.IFloatValue|null); + + /** + * Creates a new Color instance using the specified properties. + * @param [properties] Properties to set + * @returns Color instance + */ + public static create(properties?: google.type.IColor): google.type.Color; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Color message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Color; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Color; + + /** + * Verifies a Color message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Color + */ + public static fromObject(object: { [k: string]: any }): google.type.Color; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @param message Color + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Color to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; + + /** + * Verifies a LatLng message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/protos/protos.js b/protos/protos.js new file mode 100644 index 00000000..a3350142 --- /dev/null +++ b/protos/protos.js @@ -0,0 +1,112526 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("protobufjs/minimal")); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.vision = (function() { + + /** + * Namespace vision. + * @memberof google.cloud + * @namespace + */ + var vision = {}; + + vision.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.vision + * @namespace + */ + var v1 = {}; + + v1.ImageAnnotator = (function() { + + /** + * Constructs a new ImageAnnotator service. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImageAnnotator + * @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 ImageAnnotator(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ImageAnnotator.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageAnnotator; + + /** + * Creates new ImageAnnotator service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1.ImageAnnotator + * @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 {ImageAnnotator} RPC service. Useful where requests and/or responses are streamed. + */ + ImageAnnotator.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#batchAnnotateImages}. + * @memberof google.cloud.vision.v1.ImageAnnotator + * @typedef BatchAnnotateImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.BatchAnnotateImagesResponse} [response] BatchAnnotateImagesResponse + */ + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @param {google.cloud.vision.v1.ImageAnnotator.BatchAnnotateImagesCallback} callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.batchAnnotateImages = function batchAnnotateImages(request, callback) { + return this.rpcCall(batchAnnotateImages, $root.google.cloud.vision.v1.BatchAnnotateImagesRequest, $root.google.cloud.vision.v1.BatchAnnotateImagesResponse, request, callback); + }, "name", { value: "BatchAnnotateImages" }); + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#batchAnnotateFiles}. + * @memberof google.cloud.vision.v1.ImageAnnotator + * @typedef BatchAnnotateFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.BatchAnnotateFilesResponse} [response] BatchAnnotateFilesResponse + */ + + /** + * Calls BatchAnnotateFiles. + * @function batchAnnotateFiles + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IBatchAnnotateFilesRequest} request BatchAnnotateFilesRequest message or plain object + * @param {google.cloud.vision.v1.ImageAnnotator.BatchAnnotateFilesCallback} callback Node-style callback called with the error, if any, and BatchAnnotateFilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.batchAnnotateFiles = function batchAnnotateFiles(request, callback) { + return this.rpcCall(batchAnnotateFiles, $root.google.cloud.vision.v1.BatchAnnotateFilesRequest, $root.google.cloud.vision.v1.BatchAnnotateFilesResponse, request, callback); + }, "name", { value: "BatchAnnotateFiles" }); + + /** + * Calls BatchAnnotateFiles. + * @function batchAnnotateFiles + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IBatchAnnotateFilesRequest} request BatchAnnotateFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#asyncBatchAnnotateImages}. + * @memberof google.cloud.vision.v1.ImageAnnotator + * @typedef AsyncBatchAnnotateImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AsyncBatchAnnotateImages. + * @function asyncBatchAnnotateImages + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest} request AsyncBatchAnnotateImagesRequest message or plain object + * @param {google.cloud.vision.v1.ImageAnnotator.AsyncBatchAnnotateImagesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.asyncBatchAnnotateImages = function asyncBatchAnnotateImages(request, callback) { + return this.rpcCall(asyncBatchAnnotateImages, $root.google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AsyncBatchAnnotateImages" }); + + /** + * Calls AsyncBatchAnnotateImages. + * @function asyncBatchAnnotateImages + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest} request AsyncBatchAnnotateImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @memberof google.cloud.vision.v1.ImageAnnotator + * @typedef AsyncBatchAnnotateFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @param {google.cloud.vision.v1.ImageAnnotator.AsyncBatchAnnotateFilesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.asyncBatchAnnotateFiles = function asyncBatchAnnotateFiles(request, callback) { + return this.rpcCall(asyncBatchAnnotateFiles, $root.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AsyncBatchAnnotateFiles" }); + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ImageAnnotator; + })(); + + v1.Feature = (function() { + + /** + * Properties of a Feature. + * @memberof google.cloud.vision.v1 + * @interface IFeature + * @property {google.cloud.vision.v1.Feature.Type|null} [type] Feature type + * @property {number|null} [maxResults] Feature maxResults + * @property {string|null} [model] Feature model + */ + + /** + * Constructs a new Feature. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Feature. + * @implements IFeature + * @constructor + * @param {google.cloud.vision.v1.IFeature=} [properties] Properties to set + */ + function Feature(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]]; + } + + /** + * Feature type. + * @member {google.cloud.vision.v1.Feature.Type} type + * @memberof google.cloud.vision.v1.Feature + * @instance + */ + Feature.prototype.type = 0; + + /** + * Feature maxResults. + * @member {number} maxResults + * @memberof google.cloud.vision.v1.Feature + * @instance + */ + Feature.prototype.maxResults = 0; + + /** + * Feature model. + * @member {string} model + * @memberof google.cloud.vision.v1.Feature + * @instance + */ + Feature.prototype.model = ""; + + /** + * Creates a new Feature instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {google.cloud.vision.v1.IFeature=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Feature} Feature instance + */ + Feature.create = function create(properties) { + return new Feature(properties); + }; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1.Feature.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {google.cloud.vision.v1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxResults); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Feature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {google.cloud.vision.v1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.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.vision.v1.Feature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.maxResults = reader.int32(); + break; + case 3: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feature message. + * @function verify + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 11: + case 6: + case 7: + case 9: + case 10: + case 12: + case 19: + break; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Feature} Feature + */ + Feature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Feature) + return object; + var message = new $root.google.cloud.vision.v1.Feature(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "FACE_DETECTION": + case 1: + message.type = 1; + break; + case "LANDMARK_DETECTION": + case 2: + message.type = 2; + break; + case "LOGO_DETECTION": + case 3: + message.type = 3; + break; + case "LABEL_DETECTION": + case 4: + message.type = 4; + break; + case "TEXT_DETECTION": + case 5: + message.type = 5; + break; + case "DOCUMENT_TEXT_DETECTION": + case 11: + message.type = 11; + break; + case "SAFE_SEARCH_DETECTION": + case 6: + message.type = 6; + break; + case "IMAGE_PROPERTIES": + case 7: + message.type = 7; + break; + case "CROP_HINTS": + case 9: + message.type = 9; + break; + case "WEB_DETECTION": + case 10: + message.type = 10; + break; + case "PRODUCT_SEARCH": + case 12: + message.type = 12; + break; + case "OBJECT_LOCALIZATION": + case 19: + message.type = 19; + break; + } + if (object.maxResults != null) + message.maxResults = object.maxResults | 0; + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Feature + * @static + * @param {google.cloud.vision.v1.Feature} message Feature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.maxResults = 0; + object.model = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1.Feature.Type[message.type] : message.type; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + object.maxResults = message.maxResults; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this Feature to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Feature + * @instance + * @returns {Object.} JSON object + */ + Feature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1.Feature.Type + * @enum {string} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} FACE_DETECTION=1 FACE_DETECTION value + * @property {number} LANDMARK_DETECTION=2 LANDMARK_DETECTION value + * @property {number} LOGO_DETECTION=3 LOGO_DETECTION value + * @property {number} LABEL_DETECTION=4 LABEL_DETECTION value + * @property {number} TEXT_DETECTION=5 TEXT_DETECTION value + * @property {number} DOCUMENT_TEXT_DETECTION=11 DOCUMENT_TEXT_DETECTION value + * @property {number} SAFE_SEARCH_DETECTION=6 SAFE_SEARCH_DETECTION value + * @property {number} IMAGE_PROPERTIES=7 IMAGE_PROPERTIES value + * @property {number} CROP_HINTS=9 CROP_HINTS value + * @property {number} WEB_DETECTION=10 WEB_DETECTION value + * @property {number} PRODUCT_SEARCH=12 PRODUCT_SEARCH value + * @property {number} OBJECT_LOCALIZATION=19 OBJECT_LOCALIZATION value + */ + Feature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACE_DETECTION"] = 1; + values[valuesById[2] = "LANDMARK_DETECTION"] = 2; + values[valuesById[3] = "LOGO_DETECTION"] = 3; + values[valuesById[4] = "LABEL_DETECTION"] = 4; + values[valuesById[5] = "TEXT_DETECTION"] = 5; + values[valuesById[11] = "DOCUMENT_TEXT_DETECTION"] = 11; + values[valuesById[6] = "SAFE_SEARCH_DETECTION"] = 6; + values[valuesById[7] = "IMAGE_PROPERTIES"] = 7; + values[valuesById[9] = "CROP_HINTS"] = 9; + values[valuesById[10] = "WEB_DETECTION"] = 10; + values[valuesById[12] = "PRODUCT_SEARCH"] = 12; + values[valuesById[19] = "OBJECT_LOCALIZATION"] = 19; + return values; + })(); + + return Feature; + })(); + + /** + * Likelihood enum. + * @name google.cloud.vision.v1.Likelihood + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + v1.ImageSource = (function() { + + /** + * Properties of an ImageSource. + * @memberof google.cloud.vision.v1 + * @interface IImageSource + * @property {string|null} [gcsImageUri] ImageSource gcsImageUri + * @property {string|null} [imageUri] ImageSource imageUri + */ + + /** + * Constructs a new ImageSource. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImageSource. + * @implements IImageSource + * @constructor + * @param {google.cloud.vision.v1.IImageSource=} [properties] Properties to set + */ + function ImageSource(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]]; + } + + /** + * ImageSource gcsImageUri. + * @member {string} gcsImageUri + * @memberof google.cloud.vision.v1.ImageSource + * @instance + */ + ImageSource.prototype.gcsImageUri = ""; + + /** + * ImageSource imageUri. + * @member {string} imageUri + * @memberof google.cloud.vision.v1.ImageSource + * @instance + */ + ImageSource.prototype.imageUri = ""; + + /** + * Creates a new ImageSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {google.cloud.vision.v1.IImageSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImageSource} ImageSource instance + */ + ImageSource.create = function create(properties) { + return new ImageSource(properties); + }; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1.ImageSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {google.cloud.vision.v1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsImageUri); + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageUri); + return writer; + }; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {google.cloud.vision.v1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.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.vision.v1.ImageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsImageUri = reader.string(); + break; + case 2: + message.imageUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSource message. + * @function verify + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + if (!$util.isString(message.gcsImageUri)) + return "gcsImageUri: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + return null; + }; + + /** + * Creates an ImageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImageSource} ImageSource + */ + ImageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImageSource) + return object; + var message = new $root.google.cloud.vision.v1.ImageSource(); + if (object.gcsImageUri != null) + message.gcsImageUri = String(object.gcsImageUri); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + return message; + }; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImageSource + * @static + * @param {google.cloud.vision.v1.ImageSource} message ImageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsImageUri = ""; + object.imageUri = ""; + } + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + object.gcsImageUri = message.gcsImageUri; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + return object; + }; + + /** + * Converts this ImageSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImageSource + * @instance + * @returns {Object.} JSON object + */ + ImageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageSource; + })(); + + v1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.vision.v1 + * @interface IImage + * @property {Uint8Array|null} [content] Image content + * @property {google.cloud.vision.v1.IImageSource|null} [source] Image source + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.vision.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 content. + * @member {Uint8Array} content + * @memberof google.cloud.vision.v1.Image + * @instance + */ + Image.prototype.content = $util.newBuffer([]); + + /** + * Image source. + * @member {google.cloud.vision.v1.IImageSource|null|undefined} source + * @memberof google.cloud.vision.v1.Image + * @instance + */ + Image.prototype.source = null; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Image + * @static + * @param {google.cloud.vision.v1.IImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Image + * @static + * @param {google.cloud.vision.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.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.vision.v1.ImageSource.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Image + * @static + * @param {google.cloud.vision.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.vision.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.vision.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.vision.v1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.bytes(); + break; + case 2: + message.source = $root.google.cloud.vision.v1.ImageSource.decode(reader, reader.uint32()); + 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.vision.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.vision.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"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.vision.v1.ImageSource.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Image) + return object; + var message = new $root.google.cloud.vision.v1.Image(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.vision.v1.Image.source: object expected"); + message.source = $root.google.cloud.vision.v1.ImageSource.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Image + * @static + * @param {google.cloud.vision.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) { + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + object.source = null; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.vision.v1.ImageSource.toObject(message.source, options); + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Image; + })(); + + v1.FaceAnnotation = (function() { + + /** + * Properties of a FaceAnnotation. + * @memberof google.cloud.vision.v1 + * @interface IFaceAnnotation + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingPoly] FaceAnnotation boundingPoly + * @property {google.cloud.vision.v1.IBoundingPoly|null} [fdBoundingPoly] FaceAnnotation fdBoundingPoly + * @property {Array.|null} [landmarks] FaceAnnotation landmarks + * @property {number|null} [rollAngle] FaceAnnotation rollAngle + * @property {number|null} [panAngle] FaceAnnotation panAngle + * @property {number|null} [tiltAngle] FaceAnnotation tiltAngle + * @property {number|null} [detectionConfidence] FaceAnnotation detectionConfidence + * @property {number|null} [landmarkingConfidence] FaceAnnotation landmarkingConfidence + * @property {google.cloud.vision.v1.Likelihood|null} [joyLikelihood] FaceAnnotation joyLikelihood + * @property {google.cloud.vision.v1.Likelihood|null} [sorrowLikelihood] FaceAnnotation sorrowLikelihood + * @property {google.cloud.vision.v1.Likelihood|null} [angerLikelihood] FaceAnnotation angerLikelihood + * @property {google.cloud.vision.v1.Likelihood|null} [surpriseLikelihood] FaceAnnotation surpriseLikelihood + * @property {google.cloud.vision.v1.Likelihood|null} [underExposedLikelihood] FaceAnnotation underExposedLikelihood + * @property {google.cloud.vision.v1.Likelihood|null} [blurredLikelihood] FaceAnnotation blurredLikelihood + * @property {google.cloud.vision.v1.Likelihood|null} [headwearLikelihood] FaceAnnotation headwearLikelihood + */ + + /** + * Constructs a new FaceAnnotation. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a FaceAnnotation. + * @implements IFaceAnnotation + * @constructor + * @param {google.cloud.vision.v1.IFaceAnnotation=} [properties] Properties to set + */ + function FaceAnnotation(properties) { + this.landmarks = []; + 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]]; + } + + /** + * FaceAnnotation boundingPoly. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.boundingPoly = null; + + /** + * FaceAnnotation fdBoundingPoly. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} fdBoundingPoly + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.fdBoundingPoly = null; + + /** + * FaceAnnotation landmarks. + * @member {Array.} landmarks + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarks = $util.emptyArray; + + /** + * FaceAnnotation rollAngle. + * @member {number} rollAngle + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.rollAngle = 0; + + /** + * FaceAnnotation panAngle. + * @member {number} panAngle + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.panAngle = 0; + + /** + * FaceAnnotation tiltAngle. + * @member {number} tiltAngle + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.tiltAngle = 0; + + /** + * FaceAnnotation detectionConfidence. + * @member {number} detectionConfidence + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.detectionConfidence = 0; + + /** + * FaceAnnotation landmarkingConfidence. + * @member {number} landmarkingConfidence + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarkingConfidence = 0; + + /** + * FaceAnnotation joyLikelihood. + * @member {google.cloud.vision.v1.Likelihood} joyLikelihood + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.joyLikelihood = 0; + + /** + * FaceAnnotation sorrowLikelihood. + * @member {google.cloud.vision.v1.Likelihood} sorrowLikelihood + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.sorrowLikelihood = 0; + + /** + * FaceAnnotation angerLikelihood. + * @member {google.cloud.vision.v1.Likelihood} angerLikelihood + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.angerLikelihood = 0; + + /** + * FaceAnnotation surpriseLikelihood. + * @member {google.cloud.vision.v1.Likelihood} surpriseLikelihood + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.surpriseLikelihood = 0; + + /** + * FaceAnnotation underExposedLikelihood. + * @member {google.cloud.vision.v1.Likelihood} underExposedLikelihood + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.underExposedLikelihood = 0; + + /** + * FaceAnnotation blurredLikelihood. + * @member {google.cloud.vision.v1.Likelihood} blurredLikelihood + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.blurredLikelihood = 0; + + /** + * FaceAnnotation headwearLikelihood. + * @member {google.cloud.vision.v1.Likelihood} headwearLikelihood + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.headwearLikelihood = 0; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1.IFaceAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.FaceAnnotation} FaceAnnotation instance + */ + FaceAnnotation.create = function create(properties) { + return new FaceAnnotation(properties); + }; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.fdBoundingPoly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.landmarks != null && message.landmarks.length) + for (var i = 0; i < message.landmarks.length; ++i) + $root.google.cloud.vision.v1.FaceAnnotation.Landmark.encode(message.landmarks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.rollAngle); + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.panAngle); + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.tiltAngle); + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.detectionConfidence); + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.landmarkingConfidence); + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.joyLikelihood); + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sorrowLikelihood); + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.angerLikelihood); + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.surpriseLikelihood); + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.underExposedLikelihood); + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.blurredLikelihood); + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.headwearLikelihood); + return writer; + }; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.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.vision.v1.FaceAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.fdBoundingPoly = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.landmarks && message.landmarks.length)) + message.landmarks = []; + message.landmarks.push($root.google.cloud.vision.v1.FaceAnnotation.Landmark.decode(reader, reader.uint32())); + break; + case 4: + message.rollAngle = reader.float(); + break; + case 5: + message.panAngle = reader.float(); + break; + case 6: + message.tiltAngle = reader.float(); + break; + case 7: + message.detectionConfidence = reader.float(); + break; + case 8: + message.landmarkingConfidence = reader.float(); + break; + case 9: + message.joyLikelihood = reader.int32(); + break; + case 10: + message.sorrowLikelihood = reader.int32(); + break; + case 11: + message.angerLikelihood = reader.int32(); + break; + case 12: + message.surpriseLikelihood = reader.int32(); + break; + case 13: + message.underExposedLikelihood = reader.int32(); + break; + case 14: + message.blurredLikelihood = reader.int32(); + break; + case 15: + message.headwearLikelihood = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.fdBoundingPoly); + if (error) + return "fdBoundingPoly." + error; + } + if (message.landmarks != null && message.hasOwnProperty("landmarks")) { + if (!Array.isArray(message.landmarks)) + return "landmarks: array expected"; + for (var i = 0; i < message.landmarks.length; ++i) { + var error = $root.google.cloud.vision.v1.FaceAnnotation.Landmark.verify(message.landmarks[i]); + if (error) + return "landmarks." + error; + } + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + if (typeof message.rollAngle !== "number") + return "rollAngle: number expected"; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + if (typeof message.panAngle !== "number") + return "panAngle: number expected"; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + if (typeof message.tiltAngle !== "number") + return "tiltAngle: number expected"; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + if (typeof message.detectionConfidence !== "number") + return "detectionConfidence: number expected"; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + if (typeof message.landmarkingConfidence !== "number") + return "landmarkingConfidence: number expected"; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + switch (message.joyLikelihood) { + default: + return "joyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + switch (message.sorrowLikelihood) { + default: + return "sorrowLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + switch (message.angerLikelihood) { + default: + return "angerLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + switch (message.surpriseLikelihood) { + default: + return "surpriseLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + switch (message.underExposedLikelihood) { + default: + return "underExposedLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + switch (message.blurredLikelihood) { + default: + return "blurredLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + switch (message.headwearLikelihood) { + default: + return "headwearLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.FaceAnnotation} FaceAnnotation + */ + FaceAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.FaceAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.FaceAnnotation(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1.FaceAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.fdBoundingPoly != null) { + if (typeof object.fdBoundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1.FaceAnnotation.fdBoundingPoly: object expected"); + message.fdBoundingPoly = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.fdBoundingPoly); + } + if (object.landmarks) { + if (!Array.isArray(object.landmarks)) + throw TypeError(".google.cloud.vision.v1.FaceAnnotation.landmarks: array expected"); + message.landmarks = []; + for (var i = 0; i < object.landmarks.length; ++i) { + if (typeof object.landmarks[i] !== "object") + throw TypeError(".google.cloud.vision.v1.FaceAnnotation.landmarks: object expected"); + message.landmarks[i] = $root.google.cloud.vision.v1.FaceAnnotation.Landmark.fromObject(object.landmarks[i]); + } + } + if (object.rollAngle != null) + message.rollAngle = Number(object.rollAngle); + if (object.panAngle != null) + message.panAngle = Number(object.panAngle); + if (object.tiltAngle != null) + message.tiltAngle = Number(object.tiltAngle); + if (object.detectionConfidence != null) + message.detectionConfidence = Number(object.detectionConfidence); + if (object.landmarkingConfidence != null) + message.landmarkingConfidence = Number(object.landmarkingConfidence); + switch (object.joyLikelihood) { + case "UNKNOWN": + case 0: + message.joyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.joyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.joyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.joyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.joyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.joyLikelihood = 5; + break; + } + switch (object.sorrowLikelihood) { + case "UNKNOWN": + case 0: + message.sorrowLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.sorrowLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.sorrowLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.sorrowLikelihood = 3; + break; + case "LIKELY": + case 4: + message.sorrowLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.sorrowLikelihood = 5; + break; + } + switch (object.angerLikelihood) { + case "UNKNOWN": + case 0: + message.angerLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.angerLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.angerLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.angerLikelihood = 3; + break; + case "LIKELY": + case 4: + message.angerLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.angerLikelihood = 5; + break; + } + switch (object.surpriseLikelihood) { + case "UNKNOWN": + case 0: + message.surpriseLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.surpriseLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.surpriseLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.surpriseLikelihood = 3; + break; + case "LIKELY": + case 4: + message.surpriseLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.surpriseLikelihood = 5; + break; + } + switch (object.underExposedLikelihood) { + case "UNKNOWN": + case 0: + message.underExposedLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.underExposedLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.underExposedLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.underExposedLikelihood = 3; + break; + case "LIKELY": + case 4: + message.underExposedLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.underExposedLikelihood = 5; + break; + } + switch (object.blurredLikelihood) { + case "UNKNOWN": + case 0: + message.blurredLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.blurredLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.blurredLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.blurredLikelihood = 3; + break; + case "LIKELY": + case 4: + message.blurredLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.blurredLikelihood = 5; + break; + } + switch (object.headwearLikelihood) { + case "UNKNOWN": + case 0: + message.headwearLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.headwearLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.headwearLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.headwearLikelihood = 3; + break; + case "LIKELY": + case 4: + message.headwearLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.headwearLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1.FaceAnnotation} message FaceAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.landmarks = []; + if (options.defaults) { + object.boundingPoly = null; + object.fdBoundingPoly = null; + object.rollAngle = 0; + object.panAngle = 0; + object.tiltAngle = 0; + object.detectionConfidence = 0; + object.landmarkingConfidence = 0; + object.joyLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.sorrowLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.angerLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.surpriseLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.underExposedLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.blurredLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.headwearLikelihood = options.enums === String ? "UNKNOWN" : 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + object.fdBoundingPoly = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.fdBoundingPoly, options); + if (message.landmarks && message.landmarks.length) { + object.landmarks = []; + for (var j = 0; j < message.landmarks.length; ++j) + object.landmarks[j] = $root.google.cloud.vision.v1.FaceAnnotation.Landmark.toObject(message.landmarks[j], options); + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + object.rollAngle = options.json && !isFinite(message.rollAngle) ? String(message.rollAngle) : message.rollAngle; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + object.panAngle = options.json && !isFinite(message.panAngle) ? String(message.panAngle) : message.panAngle; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + object.tiltAngle = options.json && !isFinite(message.tiltAngle) ? String(message.tiltAngle) : message.tiltAngle; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + object.detectionConfidence = options.json && !isFinite(message.detectionConfidence) ? String(message.detectionConfidence) : message.detectionConfidence; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + object.landmarkingConfidence = options.json && !isFinite(message.landmarkingConfidence) ? String(message.landmarkingConfidence) : message.landmarkingConfidence; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + object.joyLikelihood = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.joyLikelihood] : message.joyLikelihood; + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + object.sorrowLikelihood = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.sorrowLikelihood] : message.sorrowLikelihood; + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + object.angerLikelihood = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.angerLikelihood] : message.angerLikelihood; + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + object.surpriseLikelihood = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.surpriseLikelihood] : message.surpriseLikelihood; + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + object.underExposedLikelihood = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.underExposedLikelihood] : message.underExposedLikelihood; + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + object.blurredLikelihood = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.blurredLikelihood] : message.blurredLikelihood; + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + object.headwearLikelihood = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.headwearLikelihood] : message.headwearLikelihood; + return object; + }; + + /** + * Converts this FaceAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.FaceAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FaceAnnotation.Landmark = (function() { + + /** + * Properties of a Landmark. + * @memberof google.cloud.vision.v1.FaceAnnotation + * @interface ILandmark + * @property {google.cloud.vision.v1.FaceAnnotation.Landmark.Type|null} [type] Landmark type + * @property {google.cloud.vision.v1.IPosition|null} [position] Landmark position + */ + + /** + * Constructs a new Landmark. + * @memberof google.cloud.vision.v1.FaceAnnotation + * @classdesc Represents a Landmark. + * @implements ILandmark + * @constructor + * @param {google.cloud.vision.v1.FaceAnnotation.ILandmark=} [properties] Properties to set + */ + function Landmark(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]]; + } + + /** + * Landmark type. + * @member {google.cloud.vision.v1.FaceAnnotation.Landmark.Type} type + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.type = 0; + + /** + * Landmark position. + * @member {google.cloud.vision.v1.IPosition|null|undefined} position + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.position = null; + + /** + * Creates a new Landmark instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1.FaceAnnotation.ILandmark=} [properties] Properties to set + * @returns {google.cloud.vision.v1.FaceAnnotation.Landmark} Landmark instance + */ + Landmark.create = function create(properties) { + return new Landmark(properties); + }; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.position != null && message.hasOwnProperty("position")) + $root.google.cloud.vision.v1.Position.encode(message.position, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.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.vision.v1.FaceAnnotation.Landmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.type = reader.int32(); + break; + case 4: + message.position = $root.google.cloud.vision.v1.Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Landmark message. + * @function verify + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Landmark.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + break; + } + if (message.position != null && message.hasOwnProperty("position")) { + var error = $root.google.cloud.vision.v1.Position.verify(message.position); + if (error) + return "position." + error; + } + return null; + }; + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.FaceAnnotation.Landmark} Landmark + */ + Landmark.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.FaceAnnotation.Landmark) + return object; + var message = new $root.google.cloud.vision.v1.FaceAnnotation.Landmark(); + switch (object.type) { + case "UNKNOWN_LANDMARK": + case 0: + message.type = 0; + break; + case "LEFT_EYE": + case 1: + message.type = 1; + break; + case "RIGHT_EYE": + case 2: + message.type = 2; + break; + case "LEFT_OF_LEFT_EYEBROW": + case 3: + message.type = 3; + break; + case "RIGHT_OF_LEFT_EYEBROW": + case 4: + message.type = 4; + break; + case "LEFT_OF_RIGHT_EYEBROW": + case 5: + message.type = 5; + break; + case "RIGHT_OF_RIGHT_EYEBROW": + case 6: + message.type = 6; + break; + case "MIDPOINT_BETWEEN_EYES": + case 7: + message.type = 7; + break; + case "NOSE_TIP": + case 8: + message.type = 8; + break; + case "UPPER_LIP": + case 9: + message.type = 9; + break; + case "LOWER_LIP": + case 10: + message.type = 10; + break; + case "MOUTH_LEFT": + case 11: + message.type = 11; + break; + case "MOUTH_RIGHT": + case 12: + message.type = 12; + break; + case "MOUTH_CENTER": + case 13: + message.type = 13; + break; + case "NOSE_BOTTOM_RIGHT": + case 14: + message.type = 14; + break; + case "NOSE_BOTTOM_LEFT": + case 15: + message.type = 15; + break; + case "NOSE_BOTTOM_CENTER": + case 16: + message.type = 16; + break; + case "LEFT_EYE_TOP_BOUNDARY": + case 17: + message.type = 17; + break; + case "LEFT_EYE_RIGHT_CORNER": + case 18: + message.type = 18; + break; + case "LEFT_EYE_BOTTOM_BOUNDARY": + case 19: + message.type = 19; + break; + case "LEFT_EYE_LEFT_CORNER": + case 20: + message.type = 20; + break; + case "RIGHT_EYE_TOP_BOUNDARY": + case 21: + message.type = 21; + break; + case "RIGHT_EYE_RIGHT_CORNER": + case 22: + message.type = 22; + break; + case "RIGHT_EYE_BOTTOM_BOUNDARY": + case 23: + message.type = 23; + break; + case "RIGHT_EYE_LEFT_CORNER": + case 24: + message.type = 24; + break; + case "LEFT_EYEBROW_UPPER_MIDPOINT": + case 25: + message.type = 25; + break; + case "RIGHT_EYEBROW_UPPER_MIDPOINT": + case 26: + message.type = 26; + break; + case "LEFT_EAR_TRAGION": + case 27: + message.type = 27; + break; + case "RIGHT_EAR_TRAGION": + case 28: + message.type = 28; + break; + case "LEFT_EYE_PUPIL": + case 29: + message.type = 29; + break; + case "RIGHT_EYE_PUPIL": + case 30: + message.type = 30; + break; + case "FOREHEAD_GLABELLA": + case 31: + message.type = 31; + break; + case "CHIN_GNATHION": + case 32: + message.type = 32; + break; + case "CHIN_LEFT_GONION": + case 33: + message.type = 33; + break; + case "CHIN_RIGHT_GONION": + case 34: + message.type = 34; + break; + } + if (object.position != null) { + if (typeof object.position !== "object") + throw TypeError(".google.cloud.vision.v1.FaceAnnotation.Landmark.position: object expected"); + message.position = $root.google.cloud.vision.v1.Position.fromObject(object.position); + } + return message; + }; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1.FaceAnnotation.Landmark} message Landmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Landmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN_LANDMARK" : 0; + object.position = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1.FaceAnnotation.Landmark.Type[message.type] : message.type; + if (message.position != null && message.hasOwnProperty("position")) + object.position = $root.google.cloud.vision.v1.Position.toObject(message.position, options); + return object; + }; + + /** + * Converts this Landmark to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.FaceAnnotation.Landmark + * @instance + * @returns {Object.} JSON object + */ + Landmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1.FaceAnnotation.Landmark.Type + * @enum {string} + * @property {number} UNKNOWN_LANDMARK=0 UNKNOWN_LANDMARK value + * @property {number} LEFT_EYE=1 LEFT_EYE value + * @property {number} RIGHT_EYE=2 RIGHT_EYE value + * @property {number} LEFT_OF_LEFT_EYEBROW=3 LEFT_OF_LEFT_EYEBROW value + * @property {number} RIGHT_OF_LEFT_EYEBROW=4 RIGHT_OF_LEFT_EYEBROW value + * @property {number} LEFT_OF_RIGHT_EYEBROW=5 LEFT_OF_RIGHT_EYEBROW value + * @property {number} RIGHT_OF_RIGHT_EYEBROW=6 RIGHT_OF_RIGHT_EYEBROW value + * @property {number} MIDPOINT_BETWEEN_EYES=7 MIDPOINT_BETWEEN_EYES value + * @property {number} NOSE_TIP=8 NOSE_TIP value + * @property {number} UPPER_LIP=9 UPPER_LIP value + * @property {number} LOWER_LIP=10 LOWER_LIP value + * @property {number} MOUTH_LEFT=11 MOUTH_LEFT value + * @property {number} MOUTH_RIGHT=12 MOUTH_RIGHT value + * @property {number} MOUTH_CENTER=13 MOUTH_CENTER value + * @property {number} NOSE_BOTTOM_RIGHT=14 NOSE_BOTTOM_RIGHT value + * @property {number} NOSE_BOTTOM_LEFT=15 NOSE_BOTTOM_LEFT value + * @property {number} NOSE_BOTTOM_CENTER=16 NOSE_BOTTOM_CENTER value + * @property {number} LEFT_EYE_TOP_BOUNDARY=17 LEFT_EYE_TOP_BOUNDARY value + * @property {number} LEFT_EYE_RIGHT_CORNER=18 LEFT_EYE_RIGHT_CORNER value + * @property {number} LEFT_EYE_BOTTOM_BOUNDARY=19 LEFT_EYE_BOTTOM_BOUNDARY value + * @property {number} LEFT_EYE_LEFT_CORNER=20 LEFT_EYE_LEFT_CORNER value + * @property {number} RIGHT_EYE_TOP_BOUNDARY=21 RIGHT_EYE_TOP_BOUNDARY value + * @property {number} RIGHT_EYE_RIGHT_CORNER=22 RIGHT_EYE_RIGHT_CORNER value + * @property {number} RIGHT_EYE_BOTTOM_BOUNDARY=23 RIGHT_EYE_BOTTOM_BOUNDARY value + * @property {number} RIGHT_EYE_LEFT_CORNER=24 RIGHT_EYE_LEFT_CORNER value + * @property {number} LEFT_EYEBROW_UPPER_MIDPOINT=25 LEFT_EYEBROW_UPPER_MIDPOINT value + * @property {number} RIGHT_EYEBROW_UPPER_MIDPOINT=26 RIGHT_EYEBROW_UPPER_MIDPOINT value + * @property {number} LEFT_EAR_TRAGION=27 LEFT_EAR_TRAGION value + * @property {number} RIGHT_EAR_TRAGION=28 RIGHT_EAR_TRAGION value + * @property {number} LEFT_EYE_PUPIL=29 LEFT_EYE_PUPIL value + * @property {number} RIGHT_EYE_PUPIL=30 RIGHT_EYE_PUPIL value + * @property {number} FOREHEAD_GLABELLA=31 FOREHEAD_GLABELLA value + * @property {number} CHIN_GNATHION=32 CHIN_GNATHION value + * @property {number} CHIN_LEFT_GONION=33 CHIN_LEFT_GONION value + * @property {number} CHIN_RIGHT_GONION=34 CHIN_RIGHT_GONION value + */ + Landmark.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_LANDMARK"] = 0; + values[valuesById[1] = "LEFT_EYE"] = 1; + values[valuesById[2] = "RIGHT_EYE"] = 2; + values[valuesById[3] = "LEFT_OF_LEFT_EYEBROW"] = 3; + values[valuesById[4] = "RIGHT_OF_LEFT_EYEBROW"] = 4; + values[valuesById[5] = "LEFT_OF_RIGHT_EYEBROW"] = 5; + values[valuesById[6] = "RIGHT_OF_RIGHT_EYEBROW"] = 6; + values[valuesById[7] = "MIDPOINT_BETWEEN_EYES"] = 7; + values[valuesById[8] = "NOSE_TIP"] = 8; + values[valuesById[9] = "UPPER_LIP"] = 9; + values[valuesById[10] = "LOWER_LIP"] = 10; + values[valuesById[11] = "MOUTH_LEFT"] = 11; + values[valuesById[12] = "MOUTH_RIGHT"] = 12; + values[valuesById[13] = "MOUTH_CENTER"] = 13; + values[valuesById[14] = "NOSE_BOTTOM_RIGHT"] = 14; + values[valuesById[15] = "NOSE_BOTTOM_LEFT"] = 15; + values[valuesById[16] = "NOSE_BOTTOM_CENTER"] = 16; + values[valuesById[17] = "LEFT_EYE_TOP_BOUNDARY"] = 17; + values[valuesById[18] = "LEFT_EYE_RIGHT_CORNER"] = 18; + values[valuesById[19] = "LEFT_EYE_BOTTOM_BOUNDARY"] = 19; + values[valuesById[20] = "LEFT_EYE_LEFT_CORNER"] = 20; + values[valuesById[21] = "RIGHT_EYE_TOP_BOUNDARY"] = 21; + values[valuesById[22] = "RIGHT_EYE_RIGHT_CORNER"] = 22; + values[valuesById[23] = "RIGHT_EYE_BOTTOM_BOUNDARY"] = 23; + values[valuesById[24] = "RIGHT_EYE_LEFT_CORNER"] = 24; + values[valuesById[25] = "LEFT_EYEBROW_UPPER_MIDPOINT"] = 25; + values[valuesById[26] = "RIGHT_EYEBROW_UPPER_MIDPOINT"] = 26; + values[valuesById[27] = "LEFT_EAR_TRAGION"] = 27; + values[valuesById[28] = "RIGHT_EAR_TRAGION"] = 28; + values[valuesById[29] = "LEFT_EYE_PUPIL"] = 29; + values[valuesById[30] = "RIGHT_EYE_PUPIL"] = 30; + values[valuesById[31] = "FOREHEAD_GLABELLA"] = 31; + values[valuesById[32] = "CHIN_GNATHION"] = 32; + values[valuesById[33] = "CHIN_LEFT_GONION"] = 33; + values[valuesById[34] = "CHIN_RIGHT_GONION"] = 34; + return values; + })(); + + return Landmark; + })(); + + return FaceAnnotation; + })(); + + v1.LocationInfo = (function() { + + /** + * Properties of a LocationInfo. + * @memberof google.cloud.vision.v1 + * @interface ILocationInfo + * @property {google.type.ILatLng|null} [latLng] LocationInfo latLng + */ + + /** + * Constructs a new LocationInfo. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo + * @constructor + * @param {google.cloud.vision.v1.ILocationInfo=} [properties] Properties to set + */ + function LocationInfo(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]]; + } + + /** + * LocationInfo latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.vision.v1.LocationInfo + * @instance + */ + LocationInfo.prototype.latLng = null; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {google.cloud.vision.v1.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1.LocationInfo} LocationInfo instance + */ + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); + }; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1.LocationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {google.cloud.vision.v1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && message.hasOwnProperty("latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1.LocationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {google.cloud.vision.v1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.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.vision.v1.LocationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationInfo message. + * @function verify + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + return null; + }; + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.LocationInfo} LocationInfo + */ + LocationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.LocationInfo) + return object; + var message = new $root.google.cloud.vision.v1.LocationInfo(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.vision.v1.LocationInfo.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + return message; + }; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.LocationInfo + * @static + * @param {google.cloud.vision.v1.LocationInfo} message LocationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.latLng = null; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + return object; + }; + + /** + * Converts this LocationInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.LocationInfo + * @instance + * @returns {Object.} JSON object + */ + LocationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationInfo; + })(); + + v1.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.vision.v1 + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [value] Property value + * @property {number|Long|null} [uint64Value] Property uint64Value + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.vision.v1.IProperty=} [properties] Properties to set + */ + function Property(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]]; + } + + /** + * Property name. + * @member {string} name + * @memberof google.cloud.vision.v1.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property value. + * @member {string} value + * @memberof google.cloud.vision.v1.Property + * @instance + */ + Property.prototype.value = ""; + + /** + * Property uint64Value. + * @member {number|Long} uint64Value + * @memberof google.cloud.vision.v1.Property + * @instance + */ + Property.prototype.uint64Value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Property + * @static + * @param {google.cloud.vision.v1.IProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Property + * @static + * @param {google.cloud.vision.v1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.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.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.uint64Value); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Property + * @static + * @param {google.cloud.vision.v1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Property message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.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.vision.v1.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.uint64Value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Property message. + * @function verify + * @memberof google.cloud.vision.v1.Property + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Property.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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (!$util.isInteger(message.uint64Value) && !(message.uint64Value && $util.isInteger(message.uint64Value.low) && $util.isInteger(message.uint64Value.high))) + return "uint64Value: integer|Long expected"; + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Property) + return object; + var message = new $root.google.cloud.vision.v1.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.uint64Value != null) + if ($util.Long) + (message.uint64Value = $util.Long.fromValue(object.uint64Value)).unsigned = true; + else if (typeof object.uint64Value === "string") + message.uint64Value = parseInt(object.uint64Value, 10); + else if (typeof object.uint64Value === "number") + message.uint64Value = object.uint64Value; + else if (typeof object.uint64Value === "object") + message.uint64Value = new $util.LongBits(object.uint64Value.low >>> 0, object.uint64Value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Property + * @static + * @param {google.cloud.vision.v1.Property} message Property + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Property.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.uint64Value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.uint64Value = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (typeof message.uint64Value === "number") + object.uint64Value = options.longs === String ? String(message.uint64Value) : message.uint64Value; + else + object.uint64Value = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Value) : options.longs === Number ? new $util.LongBits(message.uint64Value.low >>> 0, message.uint64Value.high >>> 0).toNumber(true) : message.uint64Value; + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Property + * @instance + * @returns {Object.} JSON object + */ + Property.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Property; + })(); + + v1.EntityAnnotation = (function() { + + /** + * Properties of an EntityAnnotation. + * @memberof google.cloud.vision.v1 + * @interface IEntityAnnotation + * @property {string|null} [mid] EntityAnnotation mid + * @property {string|null} [locale] EntityAnnotation locale + * @property {string|null} [description] EntityAnnotation description + * @property {number|null} [score] EntityAnnotation score + * @property {number|null} [confidence] EntityAnnotation confidence + * @property {number|null} [topicality] EntityAnnotation topicality + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingPoly] EntityAnnotation boundingPoly + * @property {Array.|null} [locations] EntityAnnotation locations + * @property {Array.|null} [properties] EntityAnnotation properties + */ + + /** + * Constructs a new EntityAnnotation. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an EntityAnnotation. + * @implements IEntityAnnotation + * @constructor + * @param {google.cloud.vision.v1.IEntityAnnotation=} [properties] Properties to set + */ + function EntityAnnotation(properties) { + this.locations = []; + this.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]]; + } + + /** + * EntityAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.mid = ""; + + /** + * EntityAnnotation locale. + * @member {string} locale + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locale = ""; + + /** + * EntityAnnotation description. + * @member {string} description + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.description = ""; + + /** + * EntityAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.score = 0; + + /** + * EntityAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.confidence = 0; + + /** + * EntityAnnotation topicality. + * @member {number} topicality + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.topicality = 0; + + /** + * EntityAnnotation boundingPoly. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.boundingPoly = null; + + /** + * EntityAnnotation locations. + * @member {Array.} locations + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locations = $util.emptyArray; + + /** + * EntityAnnotation properties. + * @member {Array.} properties + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.properties = $util.emptyArray; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1.IEntityAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.EntityAnnotation} EntityAnnotation instance + */ + EntityAnnotation.create = function create(properties) { + return new EntityAnnotation(properties); + }; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1.EntityAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.locale != null && message.hasOwnProperty("locale")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.locale); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.topicality != null && message.hasOwnProperty("topicality")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicality); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.vision.v1.LocationInfo.encode(message.locations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.vision.v1.Property.encode(message.properties[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.EntityAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.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.vision.v1.EntityAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.locale = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.confidence = reader.float(); + break; + case 6: + message.topicality = reader.float(); + break; + case 7: + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.vision.v1.LocationInfo.decode(reader, reader.uint32())); + break; + case 9: + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.vision.v1.Property.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.locale != null && message.hasOwnProperty("locale")) + if (!$util.isString(message.locale)) + return "locale: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.topicality != null && message.hasOwnProperty("topicality")) + if (typeof message.topicality !== "number") + return "topicality: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.vision.v1.LocationInfo.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.vision.v1.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates an EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.EntityAnnotation} EntityAnnotation + */ + EntityAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.EntityAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.EntityAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.locale != null) + message.locale = String(object.locale); + if (object.description != null) + message.description = String(object.description); + if (object.score != null) + message.score = Number(object.score); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.topicality != null) + message.topicality = Number(object.topicality); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1.EntityAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.vision.v1.EntityAnnotation.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.EntityAnnotation.locations: object expected"); + message.locations[i] = $root.google.cloud.vision.v1.LocationInfo.fromObject(object.locations[i]); + } + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.vision.v1.EntityAnnotation.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.vision.v1.EntityAnnotation.properties: object expected"); + message.properties[i] = $root.google.cloud.vision.v1.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1.EntityAnnotation} message EntityAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locations = []; + object.properties = []; + } + if (options.defaults) { + object.mid = ""; + object.locale = ""; + object.description = ""; + object.score = 0; + object.confidence = 0; + object.topicality = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.locale != null && message.hasOwnProperty("locale")) + object.locale = message.locale; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.topicality != null && message.hasOwnProperty("topicality")) + object.topicality = options.json && !isFinite(message.topicality) ? String(message.topicality) : message.topicality; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.vision.v1.LocationInfo.toObject(message.locations[j], options); + } + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.vision.v1.Property.toObject(message.properties[j], options); + } + return object; + }; + + /** + * Converts this EntityAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.EntityAnnotation + * @instance + * @returns {Object.} JSON object + */ + EntityAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EntityAnnotation; + })(); + + v1.LocalizedObjectAnnotation = (function() { + + /** + * Properties of a LocalizedObjectAnnotation. + * @memberof google.cloud.vision.v1 + * @interface ILocalizedObjectAnnotation + * @property {string|null} [mid] LocalizedObjectAnnotation mid + * @property {string|null} [languageCode] LocalizedObjectAnnotation languageCode + * @property {string|null} [name] LocalizedObjectAnnotation name + * @property {number|null} [score] LocalizedObjectAnnotation score + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingPoly] LocalizedObjectAnnotation boundingPoly + */ + + /** + * Constructs a new LocalizedObjectAnnotation. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a LocalizedObjectAnnotation. + * @implements ILocalizedObjectAnnotation + * @constructor + * @param {google.cloud.vision.v1.ILocalizedObjectAnnotation=} [properties] Properties to set + */ + function LocalizedObjectAnnotation(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]]; + } + + /** + * LocalizedObjectAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.mid = ""; + + /** + * LocalizedObjectAnnotation languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.languageCode = ""; + + /** + * LocalizedObjectAnnotation name. + * @member {string} name + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.name = ""; + + /** + * LocalizedObjectAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.score = 0; + + /** + * LocalizedObjectAnnotation boundingPoly. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.boundingPoly = null; + + /** + * Creates a new LocalizedObjectAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1.ILocalizedObjectAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.LocalizedObjectAnnotation} LocalizedObjectAnnotation instance + */ + LocalizedObjectAnnotation.create = function create(properties) { + return new LocalizedObjectAnnotation(properties); + }; + + /** + * Encodes the specified LocalizedObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1.LocalizedObjectAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1.ILocalizedObjectAnnotation} message LocalizedObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedObjectAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocalizedObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.LocalizedObjectAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1.ILocalizedObjectAnnotation} message LocalizedObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedObjectAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedObjectAnnotation.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.vision.v1.LocalizedObjectAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedObjectAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalizedObjectAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalizedObjectAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + return null; + }; + + /** + * Creates a LocalizedObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + */ + LocalizedObjectAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.LocalizedObjectAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.LocalizedObjectAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.name != null) + message.name = String(object.name); + if (object.score != null) + message.score = Number(object.score); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1.LocalizedObjectAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingPoly); + } + return message; + }; + + /** + * Creates a plain object from a LocalizedObjectAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1.LocalizedObjectAnnotation} message LocalizedObjectAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalizedObjectAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mid = ""; + object.languageCode = ""; + object.name = ""; + object.score = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingPoly, options); + return object; + }; + + /** + * Converts this LocalizedObjectAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.LocalizedObjectAnnotation + * @instance + * @returns {Object.} JSON object + */ + LocalizedObjectAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocalizedObjectAnnotation; + })(); + + v1.SafeSearchAnnotation = (function() { + + /** + * Properties of a SafeSearchAnnotation. + * @memberof google.cloud.vision.v1 + * @interface ISafeSearchAnnotation + * @property {google.cloud.vision.v1.Likelihood|null} [adult] SafeSearchAnnotation adult + * @property {google.cloud.vision.v1.Likelihood|null} [spoof] SafeSearchAnnotation spoof + * @property {google.cloud.vision.v1.Likelihood|null} [medical] SafeSearchAnnotation medical + * @property {google.cloud.vision.v1.Likelihood|null} [violence] SafeSearchAnnotation violence + * @property {google.cloud.vision.v1.Likelihood|null} [racy] SafeSearchAnnotation racy + * @property {number|null} [adultConfidence] SafeSearchAnnotation adultConfidence + * @property {number|null} [spoofConfidence] SafeSearchAnnotation spoofConfidence + * @property {number|null} [medicalConfidence] SafeSearchAnnotation medicalConfidence + * @property {number|null} [violenceConfidence] SafeSearchAnnotation violenceConfidence + * @property {number|null} [racyConfidence] SafeSearchAnnotation racyConfidence + * @property {number|null} [nsfwConfidence] SafeSearchAnnotation nsfwConfidence + */ + + /** + * Constructs a new SafeSearchAnnotation. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a SafeSearchAnnotation. + * @implements ISafeSearchAnnotation + * @constructor + * @param {google.cloud.vision.v1.ISafeSearchAnnotation=} [properties] Properties to set + */ + function SafeSearchAnnotation(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]]; + } + + /** + * SafeSearchAnnotation adult. + * @member {google.cloud.vision.v1.Likelihood} adult + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.adult = 0; + + /** + * SafeSearchAnnotation spoof. + * @member {google.cloud.vision.v1.Likelihood} spoof + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.spoof = 0; + + /** + * SafeSearchAnnotation medical. + * @member {google.cloud.vision.v1.Likelihood} medical + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.medical = 0; + + /** + * SafeSearchAnnotation violence. + * @member {google.cloud.vision.v1.Likelihood} violence + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.violence = 0; + + /** + * SafeSearchAnnotation racy. + * @member {google.cloud.vision.v1.Likelihood} racy + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.racy = 0; + + /** + * SafeSearchAnnotation adultConfidence. + * @member {number} adultConfidence + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.adultConfidence = 0; + + /** + * SafeSearchAnnotation spoofConfidence. + * @member {number} spoofConfidence + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.spoofConfidence = 0; + + /** + * SafeSearchAnnotation medicalConfidence. + * @member {number} medicalConfidence + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.medicalConfidence = 0; + + /** + * SafeSearchAnnotation violenceConfidence. + * @member {number} violenceConfidence + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.violenceConfidence = 0; + + /** + * SafeSearchAnnotation racyConfidence. + * @member {number} racyConfidence + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.racyConfidence = 0; + + /** + * SafeSearchAnnotation nsfwConfidence. + * @member {number} nsfwConfidence + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.nsfwConfidence = 0; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1.ISafeSearchAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.SafeSearchAnnotation} SafeSearchAnnotation instance + */ + SafeSearchAnnotation.create = function create(properties) { + return new SafeSearchAnnotation(properties); + }; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1.SafeSearchAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adult != null && message.hasOwnProperty("adult")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.adult); + if (message.spoof != null && message.hasOwnProperty("spoof")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.spoof); + if (message.medical != null && message.hasOwnProperty("medical")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.medical); + if (message.violence != null && message.hasOwnProperty("violence")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.violence); + if (message.racy != null && message.hasOwnProperty("racy")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.racy); + if (message.adultConfidence != null && message.hasOwnProperty("adultConfidence")) + writer.uint32(/* id 16, wireType 5 =*/133).float(message.adultConfidence); + if (message.spoofConfidence != null && message.hasOwnProperty("spoofConfidence")) + writer.uint32(/* id 18, wireType 5 =*/149).float(message.spoofConfidence); + if (message.medicalConfidence != null && message.hasOwnProperty("medicalConfidence")) + writer.uint32(/* id 20, wireType 5 =*/165).float(message.medicalConfidence); + if (message.violenceConfidence != null && message.hasOwnProperty("violenceConfidence")) + writer.uint32(/* id 22, wireType 5 =*/181).float(message.violenceConfidence); + if (message.racyConfidence != null && message.hasOwnProperty("racyConfidence")) + writer.uint32(/* id 24, wireType 5 =*/197).float(message.racyConfidence); + if (message.nsfwConfidence != null && message.hasOwnProperty("nsfwConfidence")) + writer.uint32(/* id 26, wireType 5 =*/213).float(message.nsfwConfidence); + return writer; + }; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.SafeSearchAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.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.vision.v1.SafeSearchAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.adult = reader.int32(); + break; + case 2: + message.spoof = reader.int32(); + break; + case 3: + message.medical = reader.int32(); + break; + case 4: + message.violence = reader.int32(); + break; + case 9: + message.racy = reader.int32(); + break; + case 16: + message.adultConfidence = reader.float(); + break; + case 18: + message.spoofConfidence = reader.float(); + break; + case 20: + message.medicalConfidence = reader.float(); + break; + case 22: + message.violenceConfidence = reader.float(); + break; + case 24: + message.racyConfidence = reader.float(); + break; + case 26: + message.nsfwConfidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafeSearchAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafeSearchAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adult != null && message.hasOwnProperty("adult")) + switch (message.adult) { + default: + return "adult: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.spoof != null && message.hasOwnProperty("spoof")) + switch (message.spoof) { + default: + return "spoof: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.medical != null && message.hasOwnProperty("medical")) + switch (message.medical) { + default: + return "medical: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.violence != null && message.hasOwnProperty("violence")) + switch (message.violence) { + default: + return "violence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.racy != null && message.hasOwnProperty("racy")) + switch (message.racy) { + default: + return "racy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.adultConfidence != null && message.hasOwnProperty("adultConfidence")) + if (typeof message.adultConfidence !== "number") + return "adultConfidence: number expected"; + if (message.spoofConfidence != null && message.hasOwnProperty("spoofConfidence")) + if (typeof message.spoofConfidence !== "number") + return "spoofConfidence: number expected"; + if (message.medicalConfidence != null && message.hasOwnProperty("medicalConfidence")) + if (typeof message.medicalConfidence !== "number") + return "medicalConfidence: number expected"; + if (message.violenceConfidence != null && message.hasOwnProperty("violenceConfidence")) + if (typeof message.violenceConfidence !== "number") + return "violenceConfidence: number expected"; + if (message.racyConfidence != null && message.hasOwnProperty("racyConfidence")) + if (typeof message.racyConfidence !== "number") + return "racyConfidence: number expected"; + if (message.nsfwConfidence != null && message.hasOwnProperty("nsfwConfidence")) + if (typeof message.nsfwConfidence !== "number") + return "nsfwConfidence: number expected"; + return null; + }; + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.SafeSearchAnnotation} SafeSearchAnnotation + */ + SafeSearchAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.SafeSearchAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.SafeSearchAnnotation(); + switch (object.adult) { + case "UNKNOWN": + case 0: + message.adult = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.adult = 1; + break; + case "UNLIKELY": + case 2: + message.adult = 2; + break; + case "POSSIBLE": + case 3: + message.adult = 3; + break; + case "LIKELY": + case 4: + message.adult = 4; + break; + case "VERY_LIKELY": + case 5: + message.adult = 5; + break; + } + switch (object.spoof) { + case "UNKNOWN": + case 0: + message.spoof = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.spoof = 1; + break; + case "UNLIKELY": + case 2: + message.spoof = 2; + break; + case "POSSIBLE": + case 3: + message.spoof = 3; + break; + case "LIKELY": + case 4: + message.spoof = 4; + break; + case "VERY_LIKELY": + case 5: + message.spoof = 5; + break; + } + switch (object.medical) { + case "UNKNOWN": + case 0: + message.medical = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.medical = 1; + break; + case "UNLIKELY": + case 2: + message.medical = 2; + break; + case "POSSIBLE": + case 3: + message.medical = 3; + break; + case "LIKELY": + case 4: + message.medical = 4; + break; + case "VERY_LIKELY": + case 5: + message.medical = 5; + break; + } + switch (object.violence) { + case "UNKNOWN": + case 0: + message.violence = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.violence = 1; + break; + case "UNLIKELY": + case 2: + message.violence = 2; + break; + case "POSSIBLE": + case 3: + message.violence = 3; + break; + case "LIKELY": + case 4: + message.violence = 4; + break; + case "VERY_LIKELY": + case 5: + message.violence = 5; + break; + } + switch (object.racy) { + case "UNKNOWN": + case 0: + message.racy = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.racy = 1; + break; + case "UNLIKELY": + case 2: + message.racy = 2; + break; + case "POSSIBLE": + case 3: + message.racy = 3; + break; + case "LIKELY": + case 4: + message.racy = 4; + break; + case "VERY_LIKELY": + case 5: + message.racy = 5; + break; + } + if (object.adultConfidence != null) + message.adultConfidence = Number(object.adultConfidence); + if (object.spoofConfidence != null) + message.spoofConfidence = Number(object.spoofConfidence); + if (object.medicalConfidence != null) + message.medicalConfidence = Number(object.medicalConfidence); + if (object.violenceConfidence != null) + message.violenceConfidence = Number(object.violenceConfidence); + if (object.racyConfidence != null) + message.racyConfidence = Number(object.racyConfidence); + if (object.nsfwConfidence != null) + message.nsfwConfidence = Number(object.nsfwConfidence); + return message; + }; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1.SafeSearchAnnotation} message SafeSearchAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafeSearchAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adult = options.enums === String ? "UNKNOWN" : 0; + object.spoof = options.enums === String ? "UNKNOWN" : 0; + object.medical = options.enums === String ? "UNKNOWN" : 0; + object.violence = options.enums === String ? "UNKNOWN" : 0; + object.racy = options.enums === String ? "UNKNOWN" : 0; + object.adultConfidence = 0; + object.spoofConfidence = 0; + object.medicalConfidence = 0; + object.violenceConfidence = 0; + object.racyConfidence = 0; + object.nsfwConfidence = 0; + } + if (message.adult != null && message.hasOwnProperty("adult")) + object.adult = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.adult] : message.adult; + if (message.spoof != null && message.hasOwnProperty("spoof")) + object.spoof = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.spoof] : message.spoof; + if (message.medical != null && message.hasOwnProperty("medical")) + object.medical = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.medical] : message.medical; + if (message.violence != null && message.hasOwnProperty("violence")) + object.violence = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.violence] : message.violence; + if (message.racy != null && message.hasOwnProperty("racy")) + object.racy = options.enums === String ? $root.google.cloud.vision.v1.Likelihood[message.racy] : message.racy; + if (message.adultConfidence != null && message.hasOwnProperty("adultConfidence")) + object.adultConfidence = options.json && !isFinite(message.adultConfidence) ? String(message.adultConfidence) : message.adultConfidence; + if (message.spoofConfidence != null && message.hasOwnProperty("spoofConfidence")) + object.spoofConfidence = options.json && !isFinite(message.spoofConfidence) ? String(message.spoofConfidence) : message.spoofConfidence; + if (message.medicalConfidence != null && message.hasOwnProperty("medicalConfidence")) + object.medicalConfidence = options.json && !isFinite(message.medicalConfidence) ? String(message.medicalConfidence) : message.medicalConfidence; + if (message.violenceConfidence != null && message.hasOwnProperty("violenceConfidence")) + object.violenceConfidence = options.json && !isFinite(message.violenceConfidence) ? String(message.violenceConfidence) : message.violenceConfidence; + if (message.racyConfidence != null && message.hasOwnProperty("racyConfidence")) + object.racyConfidence = options.json && !isFinite(message.racyConfidence) ? String(message.racyConfidence) : message.racyConfidence; + if (message.nsfwConfidence != null && message.hasOwnProperty("nsfwConfidence")) + object.nsfwConfidence = options.json && !isFinite(message.nsfwConfidence) ? String(message.nsfwConfidence) : message.nsfwConfidence; + return object; + }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.SafeSearchAnnotation + * @instance + * @returns {Object.} JSON object + */ + SafeSearchAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SafeSearchAnnotation; + })(); + + v1.LatLongRect = (function() { + + /** + * Properties of a LatLongRect. + * @memberof google.cloud.vision.v1 + * @interface ILatLongRect + * @property {google.type.ILatLng|null} [minLatLng] LatLongRect minLatLng + * @property {google.type.ILatLng|null} [maxLatLng] LatLongRect maxLatLng + */ + + /** + * Constructs a new LatLongRect. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a LatLongRect. + * @implements ILatLongRect + * @constructor + * @param {google.cloud.vision.v1.ILatLongRect=} [properties] Properties to set + */ + function LatLongRect(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]]; + } + + /** + * LatLongRect minLatLng. + * @member {google.type.ILatLng|null|undefined} minLatLng + * @memberof google.cloud.vision.v1.LatLongRect + * @instance + */ + LatLongRect.prototype.minLatLng = null; + + /** + * LatLongRect maxLatLng. + * @member {google.type.ILatLng|null|undefined} maxLatLng + * @memberof google.cloud.vision.v1.LatLongRect + * @instance + */ + LatLongRect.prototype.maxLatLng = null; + + /** + * Creates a new LatLongRect instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {google.cloud.vision.v1.ILatLongRect=} [properties] Properties to set + * @returns {google.cloud.vision.v1.LatLongRect} LatLongRect instance + */ + LatLongRect.create = function create(properties) { + return new LatLongRect(properties); + }; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1.LatLongRect.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {google.cloud.vision.v1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + $root.google.type.LatLng.encode(message.minLatLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + $root.google.type.LatLng.encode(message.maxLatLng, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1.LatLongRect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {google.cloud.vision.v1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.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.vision.v1.LatLongRect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 2: + message.maxLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLongRect message. + * @function verify + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLongRect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) { + var error = $root.google.type.LatLng.verify(message.minLatLng); + if (error) + return "minLatLng." + error; + } + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) { + var error = $root.google.type.LatLng.verify(message.maxLatLng); + if (error) + return "maxLatLng." + error; + } + return null; + }; + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.LatLongRect} LatLongRect + */ + LatLongRect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.LatLongRect) + return object; + var message = new $root.google.cloud.vision.v1.LatLongRect(); + if (object.minLatLng != null) { + if (typeof object.minLatLng !== "object") + throw TypeError(".google.cloud.vision.v1.LatLongRect.minLatLng: object expected"); + message.minLatLng = $root.google.type.LatLng.fromObject(object.minLatLng); + } + if (object.maxLatLng != null) { + if (typeof object.maxLatLng !== "object") + throw TypeError(".google.cloud.vision.v1.LatLongRect.maxLatLng: object expected"); + message.maxLatLng = $root.google.type.LatLng.fromObject(object.maxLatLng); + } + return message; + }; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.LatLongRect + * @static + * @param {google.cloud.vision.v1.LatLongRect} message LatLongRect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLongRect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minLatLng = null; + object.maxLatLng = null; + } + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + object.minLatLng = $root.google.type.LatLng.toObject(message.minLatLng, options); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + object.maxLatLng = $root.google.type.LatLng.toObject(message.maxLatLng, options); + return object; + }; + + /** + * Converts this LatLongRect to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.LatLongRect + * @instance + * @returns {Object.} JSON object + */ + LatLongRect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LatLongRect; + })(); + + v1.ColorInfo = (function() { + + /** + * Properties of a ColorInfo. + * @memberof google.cloud.vision.v1 + * @interface IColorInfo + * @property {google.type.IColor|null} [color] ColorInfo color + * @property {number|null} [score] ColorInfo score + * @property {number|null} [pixelFraction] ColorInfo pixelFraction + */ + + /** + * Constructs a new ColorInfo. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ColorInfo. + * @implements IColorInfo + * @constructor + * @param {google.cloud.vision.v1.IColorInfo=} [properties] Properties to set + */ + function ColorInfo(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]]; + } + + /** + * ColorInfo color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.vision.v1.ColorInfo + * @instance + */ + ColorInfo.prototype.color = null; + + /** + * ColorInfo score. + * @member {number} score + * @memberof google.cloud.vision.v1.ColorInfo + * @instance + */ + ColorInfo.prototype.score = 0; + + /** + * ColorInfo pixelFraction. + * @member {number} pixelFraction + * @memberof google.cloud.vision.v1.ColorInfo + * @instance + */ + ColorInfo.prototype.pixelFraction = 0; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {google.cloud.vision.v1.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ColorInfo} ColorInfo instance + */ + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); + }; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1.ColorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {google.cloud.vision.v1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.color != null && message.hasOwnProperty("color")) + $root.google.type.Color.encode(message.color, 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); + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.pixelFraction); + return writer; + }; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ColorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {google.cloud.vision.v1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.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.vision.v1.ColorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.color = $root.google.type.Color.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pixelFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColorInfo message. + * @function verify + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + if (typeof message.pixelFraction !== "number") + return "pixelFraction: number expected"; + return null; + }; + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ColorInfo} ColorInfo + */ + ColorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ColorInfo) + return object; + var message = new $root.google.cloud.vision.v1.ColorInfo(); + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.vision.v1.ColorInfo.color: object expected"); + message.color = $root.google.type.Color.fromObject(object.color); + } + if (object.score != null) + message.score = Number(object.score); + if (object.pixelFraction != null) + message.pixelFraction = Number(object.pixelFraction); + return message; + }; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ColorInfo + * @static + * @param {google.cloud.vision.v1.ColorInfo} message ColorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.color = null; + object.score = 0; + object.pixelFraction = 0; + } + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.type.Color.toObject(message.color, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + object.pixelFraction = options.json && !isFinite(message.pixelFraction) ? String(message.pixelFraction) : message.pixelFraction; + return object; + }; + + /** + * Converts this ColorInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ColorInfo + * @instance + * @returns {Object.} JSON object + */ + ColorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ColorInfo; + })(); + + v1.DominantColorsAnnotation = (function() { + + /** + * Properties of a DominantColorsAnnotation. + * @memberof google.cloud.vision.v1 + * @interface IDominantColorsAnnotation + * @property {Array.|null} [colors] DominantColorsAnnotation colors + */ + + /** + * Constructs a new DominantColorsAnnotation. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a DominantColorsAnnotation. + * @implements IDominantColorsAnnotation + * @constructor + * @param {google.cloud.vision.v1.IDominantColorsAnnotation=} [properties] Properties to set + */ + function DominantColorsAnnotation(properties) { + this.colors = []; + 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]]; + } + + /** + * DominantColorsAnnotation colors. + * @member {Array.} colors + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @instance + */ + DominantColorsAnnotation.prototype.colors = $util.emptyArray; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1.IDominantColorsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.DominantColorsAnnotation} DominantColorsAnnotation instance + */ + DominantColorsAnnotation.create = function create(properties) { + return new DominantColorsAnnotation(properties); + }; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1.DominantColorsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.colors != null && message.colors.length) + for (var i = 0; i < message.colors.length; ++i) + $root.google.cloud.vision.v1.ColorInfo.encode(message.colors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DominantColorsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.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.vision.v1.DominantColorsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.colors && message.colors.length)) + message.colors = []; + message.colors.push($root.google.cloud.vision.v1.ColorInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominantColorsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominantColorsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.colors != null && message.hasOwnProperty("colors")) { + if (!Array.isArray(message.colors)) + return "colors: array expected"; + for (var i = 0; i < message.colors.length; ++i) { + var error = $root.google.cloud.vision.v1.ColorInfo.verify(message.colors[i]); + if (error) + return "colors." + error; + } + } + return null; + }; + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.DominantColorsAnnotation} DominantColorsAnnotation + */ + DominantColorsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.DominantColorsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.DominantColorsAnnotation(); + if (object.colors) { + if (!Array.isArray(object.colors)) + throw TypeError(".google.cloud.vision.v1.DominantColorsAnnotation.colors: array expected"); + message.colors = []; + for (var i = 0; i < object.colors.length; ++i) { + if (typeof object.colors[i] !== "object") + throw TypeError(".google.cloud.vision.v1.DominantColorsAnnotation.colors: object expected"); + message.colors[i] = $root.google.cloud.vision.v1.ColorInfo.fromObject(object.colors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1.DominantColorsAnnotation} message DominantColorsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominantColorsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.colors = []; + if (message.colors && message.colors.length) { + object.colors = []; + for (var j = 0; j < message.colors.length; ++j) + object.colors[j] = $root.google.cloud.vision.v1.ColorInfo.toObject(message.colors[j], options); + } + return object; + }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.DominantColorsAnnotation + * @instance + * @returns {Object.} JSON object + */ + DominantColorsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominantColorsAnnotation; + })(); + + v1.ImageProperties = (function() { + + /** + * Properties of an ImageProperties. + * @memberof google.cloud.vision.v1 + * @interface IImageProperties + * @property {google.cloud.vision.v1.IDominantColorsAnnotation|null} [dominantColors] ImageProperties dominantColors + */ + + /** + * Constructs a new ImageProperties. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImageProperties. + * @implements IImageProperties + * @constructor + * @param {google.cloud.vision.v1.IImageProperties=} [properties] Properties to set + */ + function ImageProperties(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]]; + } + + /** + * ImageProperties dominantColors. + * @member {google.cloud.vision.v1.IDominantColorsAnnotation|null|undefined} dominantColors + * @memberof google.cloud.vision.v1.ImageProperties + * @instance + */ + ImageProperties.prototype.dominantColors = null; + + /** + * Creates a new ImageProperties instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {google.cloud.vision.v1.IImageProperties=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImageProperties} ImageProperties instance + */ + ImageProperties.create = function create(properties) { + return new ImageProperties(properties); + }; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1.ImageProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {google.cloud.vision.v1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + $root.google.cloud.vision.v1.DominantColorsAnnotation.encode(message.dominantColors, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {google.cloud.vision.v1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.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.vision.v1.ImageProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dominantColors = $root.google.cloud.vision.v1.DominantColorsAnnotation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageProperties message. + * @function verify + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) { + var error = $root.google.cloud.vision.v1.DominantColorsAnnotation.verify(message.dominantColors); + if (error) + return "dominantColors." + error; + } + return null; + }; + + /** + * Creates an ImageProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImageProperties} ImageProperties + */ + ImageProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImageProperties) + return object; + var message = new $root.google.cloud.vision.v1.ImageProperties(); + if (object.dominantColors != null) { + if (typeof object.dominantColors !== "object") + throw TypeError(".google.cloud.vision.v1.ImageProperties.dominantColors: object expected"); + message.dominantColors = $root.google.cloud.vision.v1.DominantColorsAnnotation.fromObject(object.dominantColors); + } + return message; + }; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImageProperties + * @static + * @param {google.cloud.vision.v1.ImageProperties} message ImageProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dominantColors = null; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + object.dominantColors = $root.google.cloud.vision.v1.DominantColorsAnnotation.toObject(message.dominantColors, options); + return object; + }; + + /** + * Converts this ImageProperties to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImageProperties + * @instance + * @returns {Object.} JSON object + */ + ImageProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageProperties; + })(); + + v1.CropHint = (function() { + + /** + * Properties of a CropHint. + * @memberof google.cloud.vision.v1 + * @interface ICropHint + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingPoly] CropHint boundingPoly + * @property {number|null} [confidence] CropHint confidence + * @property {number|null} [importanceFraction] CropHint importanceFraction + */ + + /** + * Constructs a new CropHint. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a CropHint. + * @implements ICropHint + * @constructor + * @param {google.cloud.vision.v1.ICropHint=} [properties] Properties to set + */ + function CropHint(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]]; + } + + /** + * CropHint boundingPoly. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1.CropHint + * @instance + */ + CropHint.prototype.boundingPoly = null; + + /** + * CropHint confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.CropHint + * @instance + */ + CropHint.prototype.confidence = 0; + + /** + * CropHint importanceFraction. + * @member {number} importanceFraction + * @memberof google.cloud.vision.v1.CropHint + * @instance + */ + CropHint.prototype.importanceFraction = 0; + + /** + * Creates a new CropHint instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {google.cloud.vision.v1.ICropHint=} [properties] Properties to set + * @returns {google.cloud.vision.v1.CropHint} CropHint instance + */ + CropHint.create = function create(properties) { + return new CropHint(properties); + }; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1.CropHint.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {google.cloud.vision.v1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.importanceFraction); + return writer; + }; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CropHint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {google.cloud.vision.v1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.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.vision.v1.CropHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.importanceFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHint message. + * @function verify + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + if (typeof message.importanceFraction !== "number") + return "importanceFraction: number expected"; + return null; + }; + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.CropHint} CropHint + */ + CropHint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.CropHint) + return object; + var message = new $root.google.cloud.vision.v1.CropHint(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1.CropHint.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.importanceFraction != null) + message.importanceFraction = Number(object.importanceFraction); + return message; + }; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.CropHint + * @static + * @param {google.cloud.vision.v1.CropHint} message CropHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingPoly = null; + object.confidence = 0; + object.importanceFraction = 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + object.importanceFraction = options.json && !isFinite(message.importanceFraction) ? String(message.importanceFraction) : message.importanceFraction; + return object; + }; + + /** + * Converts this CropHint to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.CropHint + * @instance + * @returns {Object.} JSON object + */ + CropHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHint; + })(); + + v1.CropHintsAnnotation = (function() { + + /** + * Properties of a CropHintsAnnotation. + * @memberof google.cloud.vision.v1 + * @interface ICropHintsAnnotation + * @property {Array.|null} [cropHints] CropHintsAnnotation cropHints + */ + + /** + * Constructs a new CropHintsAnnotation. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a CropHintsAnnotation. + * @implements ICropHintsAnnotation + * @constructor + * @param {google.cloud.vision.v1.ICropHintsAnnotation=} [properties] Properties to set + */ + function CropHintsAnnotation(properties) { + this.cropHints = []; + 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]]; + } + + /** + * CropHintsAnnotation cropHints. + * @member {Array.} cropHints + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @instance + */ + CropHintsAnnotation.prototype.cropHints = $util.emptyArray; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1.ICropHintsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.CropHintsAnnotation} CropHintsAnnotation instance + */ + CropHintsAnnotation.create = function create(properties) { + return new CropHintsAnnotation(properties); + }; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1.CropHintsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cropHints != null && message.cropHints.length) + for (var i = 0; i < message.cropHints.length; ++i) + $root.google.cloud.vision.v1.CropHint.encode(message.cropHints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CropHintsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.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.vision.v1.CropHintsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cropHints && message.cropHints.length)) + message.cropHints = []; + message.cropHints.push($root.google.cloud.vision.v1.CropHint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cropHints != null && message.hasOwnProperty("cropHints")) { + if (!Array.isArray(message.cropHints)) + return "cropHints: array expected"; + for (var i = 0; i < message.cropHints.length; ++i) { + var error = $root.google.cloud.vision.v1.CropHint.verify(message.cropHints[i]); + if (error) + return "cropHints." + error; + } + } + return null; + }; + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.CropHintsAnnotation} CropHintsAnnotation + */ + CropHintsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.CropHintsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.CropHintsAnnotation(); + if (object.cropHints) { + if (!Array.isArray(object.cropHints)) + throw TypeError(".google.cloud.vision.v1.CropHintsAnnotation.cropHints: array expected"); + message.cropHints = []; + for (var i = 0; i < object.cropHints.length; ++i) { + if (typeof object.cropHints[i] !== "object") + throw TypeError(".google.cloud.vision.v1.CropHintsAnnotation.cropHints: object expected"); + message.cropHints[i] = $root.google.cloud.vision.v1.CropHint.fromObject(object.cropHints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1.CropHintsAnnotation} message CropHintsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cropHints = []; + if (message.cropHints && message.cropHints.length) { + object.cropHints = []; + for (var j = 0; j < message.cropHints.length; ++j) + object.cropHints[j] = $root.google.cloud.vision.v1.CropHint.toObject(message.cropHints[j], options); + } + return object; + }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.CropHintsAnnotation + * @instance + * @returns {Object.} JSON object + */ + CropHintsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsAnnotation; + })(); + + v1.CropHintsParams = (function() { + + /** + * Properties of a CropHintsParams. + * @memberof google.cloud.vision.v1 + * @interface ICropHintsParams + * @property {Array.|null} [aspectRatios] CropHintsParams aspectRatios + */ + + /** + * Constructs a new CropHintsParams. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a CropHintsParams. + * @implements ICropHintsParams + * @constructor + * @param {google.cloud.vision.v1.ICropHintsParams=} [properties] Properties to set + */ + function CropHintsParams(properties) { + this.aspectRatios = []; + 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]]; + } + + /** + * CropHintsParams aspectRatios. + * @member {Array.} aspectRatios + * @memberof google.cloud.vision.v1.CropHintsParams + * @instance + */ + CropHintsParams.prototype.aspectRatios = $util.emptyArray; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {google.cloud.vision.v1.ICropHintsParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1.CropHintsParams} CropHintsParams instance + */ + CropHintsParams.create = function create(properties) { + return new CropHintsParams(properties); + }; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1.CropHintsParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {google.cloud.vision.v1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aspectRatios != null && message.aspectRatios.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.aspectRatios.length; ++i) + writer.float(message.aspectRatios[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CropHintsParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {google.cloud.vision.v1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.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.vision.v1.CropHintsParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.aspectRatios && message.aspectRatios.length)) + message.aspectRatios = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.aspectRatios.push(reader.float()); + } else + message.aspectRatios.push(reader.float()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsParams message. + * @function verify + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aspectRatios != null && message.hasOwnProperty("aspectRatios")) { + if (!Array.isArray(message.aspectRatios)) + return "aspectRatios: array expected"; + for (var i = 0; i < message.aspectRatios.length; ++i) + if (typeof message.aspectRatios[i] !== "number") + return "aspectRatios: number[] expected"; + } + return null; + }; + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.CropHintsParams} CropHintsParams + */ + CropHintsParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.CropHintsParams) + return object; + var message = new $root.google.cloud.vision.v1.CropHintsParams(); + if (object.aspectRatios) { + if (!Array.isArray(object.aspectRatios)) + throw TypeError(".google.cloud.vision.v1.CropHintsParams.aspectRatios: array expected"); + message.aspectRatios = []; + for (var i = 0; i < object.aspectRatios.length; ++i) + message.aspectRatios[i] = Number(object.aspectRatios[i]); + } + return message; + }; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.CropHintsParams + * @static + * @param {google.cloud.vision.v1.CropHintsParams} message CropHintsParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aspectRatios = []; + if (message.aspectRatios && message.aspectRatios.length) { + object.aspectRatios = []; + for (var j = 0; j < message.aspectRatios.length; ++j) + object.aspectRatios[j] = options.json && !isFinite(message.aspectRatios[j]) ? String(message.aspectRatios[j]) : message.aspectRatios[j]; + } + return object; + }; + + /** + * Converts this CropHintsParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.CropHintsParams + * @instance + * @returns {Object.} JSON object + */ + CropHintsParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsParams; + })(); + + v1.WebDetectionParams = (function() { + + /** + * Properties of a WebDetectionParams. + * @memberof google.cloud.vision.v1 + * @interface IWebDetectionParams + * @property {boolean|null} [includeGeoResults] WebDetectionParams includeGeoResults + */ + + /** + * Constructs a new WebDetectionParams. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a WebDetectionParams. + * @implements IWebDetectionParams + * @constructor + * @param {google.cloud.vision.v1.IWebDetectionParams=} [properties] Properties to set + */ + function WebDetectionParams(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]]; + } + + /** + * WebDetectionParams includeGeoResults. + * @member {boolean} includeGeoResults + * @memberof google.cloud.vision.v1.WebDetectionParams + * @instance + */ + WebDetectionParams.prototype.includeGeoResults = false; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1.IWebDetectionParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1.WebDetectionParams} WebDetectionParams instance + */ + WebDetectionParams.create = function create(properties) { + return new WebDetectionParams(properties); + }; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1.WebDetectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeGeoResults); + return writer; + }; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.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.vision.v1.WebDetectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.includeGeoResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetectionParams message. + * @function verify + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetectionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + if (typeof message.includeGeoResults !== "boolean") + return "includeGeoResults: boolean expected"; + return null; + }; + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.WebDetectionParams} WebDetectionParams + */ + WebDetectionParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.WebDetectionParams) + return object; + var message = new $root.google.cloud.vision.v1.WebDetectionParams(); + if (object.includeGeoResults != null) + message.includeGeoResults = Boolean(object.includeGeoResults); + return message; + }; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1.WebDetectionParams} message WebDetectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.includeGeoResults = false; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + object.includeGeoResults = message.includeGeoResults; + return object; + }; + + /** + * Converts this WebDetectionParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.WebDetectionParams + * @instance + * @returns {Object.} JSON object + */ + WebDetectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebDetectionParams; + })(); + + v1.ImageContext = (function() { + + /** + * Properties of an ImageContext. + * @memberof google.cloud.vision.v1 + * @interface IImageContext + * @property {google.cloud.vision.v1.ILatLongRect|null} [latLongRect] ImageContext latLongRect + * @property {Array.|null} [languageHints] ImageContext languageHints + * @property {google.cloud.vision.v1.ICropHintsParams|null} [cropHintsParams] ImageContext cropHintsParams + * @property {google.cloud.vision.v1.IProductSearchParams|null} [productSearchParams] ImageContext productSearchParams + * @property {google.cloud.vision.v1.IWebDetectionParams|null} [webDetectionParams] ImageContext webDetectionParams + */ + + /** + * Constructs a new ImageContext. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImageContext. + * @implements IImageContext + * @constructor + * @param {google.cloud.vision.v1.IImageContext=} [properties] Properties to set + */ + function ImageContext(properties) { + this.languageHints = []; + 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]]; + } + + /** + * ImageContext latLongRect. + * @member {google.cloud.vision.v1.ILatLongRect|null|undefined} latLongRect + * @memberof google.cloud.vision.v1.ImageContext + * @instance + */ + ImageContext.prototype.latLongRect = null; + + /** + * ImageContext languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.vision.v1.ImageContext + * @instance + */ + ImageContext.prototype.languageHints = $util.emptyArray; + + /** + * ImageContext cropHintsParams. + * @member {google.cloud.vision.v1.ICropHintsParams|null|undefined} cropHintsParams + * @memberof google.cloud.vision.v1.ImageContext + * @instance + */ + ImageContext.prototype.cropHintsParams = null; + + /** + * ImageContext productSearchParams. + * @member {google.cloud.vision.v1.IProductSearchParams|null|undefined} productSearchParams + * @memberof google.cloud.vision.v1.ImageContext + * @instance + */ + ImageContext.prototype.productSearchParams = null; + + /** + * ImageContext webDetectionParams. + * @member {google.cloud.vision.v1.IWebDetectionParams|null|undefined} webDetectionParams + * @memberof google.cloud.vision.v1.ImageContext + * @instance + */ + ImageContext.prototype.webDetectionParams = null; + + /** + * Creates a new ImageContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {google.cloud.vision.v1.IImageContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImageContext} ImageContext instance + */ + ImageContext.create = function create(properties) { + return new ImageContext(properties); + }; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1.ImageContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {google.cloud.vision.v1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + $root.google.cloud.vision.v1.LatLongRect.encode(message.latLongRect, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageHints[i]); + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + $root.google.cloud.vision.v1.CropHintsParams.encode(message.cropHintsParams, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) + $root.google.cloud.vision.v1.ProductSearchParams.encode(message.productSearchParams, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + $root.google.cloud.vision.v1.WebDetectionParams.encode(message.webDetectionParams, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {google.cloud.vision.v1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.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.vision.v1.ImageContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLongRect = $root.google.cloud.vision.v1.LatLongRect.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + case 4: + message.cropHintsParams = $root.google.cloud.vision.v1.CropHintsParams.decode(reader, reader.uint32()); + break; + case 5: + message.productSearchParams = $root.google.cloud.vision.v1.ProductSearchParams.decode(reader, reader.uint32()); + break; + case 6: + message.webDetectionParams = $root.google.cloud.vision.v1.WebDetectionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageContext message. + * @function verify + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) { + var error = $root.google.cloud.vision.v1.LatLongRect.verify(message.latLongRect); + if (error) + return "latLongRect." + error; + } + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) { + var error = $root.google.cloud.vision.v1.CropHintsParams.verify(message.cropHintsParams); + if (error) + return "cropHintsParams." + error; + } + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) { + var error = $root.google.cloud.vision.v1.ProductSearchParams.verify(message.productSearchParams); + if (error) + return "productSearchParams." + error; + } + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) { + var error = $root.google.cloud.vision.v1.WebDetectionParams.verify(message.webDetectionParams); + if (error) + return "webDetectionParams." + error; + } + return null; + }; + + /** + * Creates an ImageContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImageContext} ImageContext + */ + ImageContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImageContext) + return object; + var message = new $root.google.cloud.vision.v1.ImageContext(); + if (object.latLongRect != null) { + if (typeof object.latLongRect !== "object") + throw TypeError(".google.cloud.vision.v1.ImageContext.latLongRect: object expected"); + message.latLongRect = $root.google.cloud.vision.v1.LatLongRect.fromObject(object.latLongRect); + } + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.vision.v1.ImageContext.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + if (object.cropHintsParams != null) { + if (typeof object.cropHintsParams !== "object") + throw TypeError(".google.cloud.vision.v1.ImageContext.cropHintsParams: object expected"); + message.cropHintsParams = $root.google.cloud.vision.v1.CropHintsParams.fromObject(object.cropHintsParams); + } + if (object.productSearchParams != null) { + if (typeof object.productSearchParams !== "object") + throw TypeError(".google.cloud.vision.v1.ImageContext.productSearchParams: object expected"); + message.productSearchParams = $root.google.cloud.vision.v1.ProductSearchParams.fromObject(object.productSearchParams); + } + if (object.webDetectionParams != null) { + if (typeof object.webDetectionParams !== "object") + throw TypeError(".google.cloud.vision.v1.ImageContext.webDetectionParams: object expected"); + message.webDetectionParams = $root.google.cloud.vision.v1.WebDetectionParams.fromObject(object.webDetectionParams); + } + return message; + }; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImageContext + * @static + * @param {google.cloud.vision.v1.ImageContext} message ImageContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (options.defaults) { + object.latLongRect = null; + object.cropHintsParams = null; + object.productSearchParams = null; + object.webDetectionParams = null; + } + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + object.latLongRect = $root.google.cloud.vision.v1.LatLongRect.toObject(message.latLongRect, options); + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + object.cropHintsParams = $root.google.cloud.vision.v1.CropHintsParams.toObject(message.cropHintsParams, options); + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) + object.productSearchParams = $root.google.cloud.vision.v1.ProductSearchParams.toObject(message.productSearchParams, options); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + object.webDetectionParams = $root.google.cloud.vision.v1.WebDetectionParams.toObject(message.webDetectionParams, options); + return object; + }; + + /** + * Converts this ImageContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImageContext + * @instance + * @returns {Object.} JSON object + */ + ImageContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageContext; + })(); + + v1.AnnotateImageRequest = (function() { + + /** + * Properties of an AnnotateImageRequest. + * @memberof google.cloud.vision.v1 + * @interface IAnnotateImageRequest + * @property {google.cloud.vision.v1.IImage|null} [image] AnnotateImageRequest image + * @property {Array.|null} [features] AnnotateImageRequest features + * @property {google.cloud.vision.v1.IImageContext|null} [imageContext] AnnotateImageRequest imageContext + */ + + /** + * Constructs a new AnnotateImageRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AnnotateImageRequest. + * @implements IAnnotateImageRequest + * @constructor + * @param {google.cloud.vision.v1.IAnnotateImageRequest=} [properties] Properties to set + */ + function AnnotateImageRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AnnotateImageRequest image. + * @member {google.cloud.vision.v1.IImage|null|undefined} image + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.image = null; + + /** + * AnnotateImageRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateImageRequest imageContext. + * @member {google.cloud.vision.v1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.imageContext = null; + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1.IAnnotateImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AnnotateImageRequest} AnnotateImageRequest instance + */ + AnnotateImageRequest.create = function create(properties) { + return new AnnotateImageRequest(properties); + }; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && message.hasOwnProperty("image")) + $root.google.cloud.vision.v1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.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.vision.v1.AnnotateImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = $root.google.cloud.vision.v1.Image.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1.ImageContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.vision.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AnnotateImageRequest} AnnotateImageRequest + */ + AnnotateImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AnnotateImageRequest) + return object; + var message = new $root.google.cloud.vision.v1.AnnotateImageRequest(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageRequest.image: object expected"); + message.image = $root.google.cloud.vision.v1.Image.fromObject(object.image); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1.AnnotateImageRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1.ImageContext.fromObject(object.imageContext); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1.AnnotateImageRequest} message AnnotateImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.image = null; + object.imageContext = null; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.vision.v1.Image.toObject(message.image, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1.ImageContext.toObject(message.imageContext, options); + return object; + }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AnnotateImageRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageRequest; + })(); + + v1.ImageAnnotationContext = (function() { + + /** + * Properties of an ImageAnnotationContext. + * @memberof google.cloud.vision.v1 + * @interface IImageAnnotationContext + * @property {string|null} [uri] ImageAnnotationContext uri + * @property {number|null} [pageNumber] ImageAnnotationContext pageNumber + */ + + /** + * Constructs a new ImageAnnotationContext. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImageAnnotationContext. + * @implements IImageAnnotationContext + * @constructor + * @param {google.cloud.vision.v1.IImageAnnotationContext=} [properties] Properties to set + */ + function ImageAnnotationContext(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]]; + } + + /** + * ImageAnnotationContext uri. + * @member {string} uri + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.uri = ""; + + /** + * ImageAnnotationContext pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.pageNumber = 0; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1.IImageAnnotationContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImageAnnotationContext} ImageAnnotationContext instance + */ + ImageAnnotationContext.create = function create(properties) { + return new ImageAnnotationContext(properties); + }; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1.ImageAnnotationContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + return writer; + }; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImageAnnotationContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.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.vision.v1.ImageAnnotationContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + message.pageNumber = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageAnnotationContext message. + * @function verify + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageAnnotationContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + return null; + }; + + /** + * Creates an ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImageAnnotationContext} ImageAnnotationContext + */ + ImageAnnotationContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImageAnnotationContext) + return object; + var message = new $root.google.cloud.vision.v1.ImageAnnotationContext(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + return message; + }; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1.ImageAnnotationContext} message ImageAnnotationContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageAnnotationContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.pageNumber = 0; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + return object; + }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImageAnnotationContext + * @instance + * @returns {Object.} JSON object + */ + ImageAnnotationContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageAnnotationContext; + })(); + + v1.AnnotateImageResponse = (function() { + + /** + * Properties of an AnnotateImageResponse. + * @memberof google.cloud.vision.v1 + * @interface IAnnotateImageResponse + * @property {Array.|null} [faceAnnotations] AnnotateImageResponse faceAnnotations + * @property {Array.|null} [landmarkAnnotations] AnnotateImageResponse landmarkAnnotations + * @property {Array.|null} [logoAnnotations] AnnotateImageResponse logoAnnotations + * @property {Array.|null} [labelAnnotations] AnnotateImageResponse labelAnnotations + * @property {Array.|null} [localizedObjectAnnotations] AnnotateImageResponse localizedObjectAnnotations + * @property {Array.|null} [textAnnotations] AnnotateImageResponse textAnnotations + * @property {google.cloud.vision.v1.ITextAnnotation|null} [fullTextAnnotation] AnnotateImageResponse fullTextAnnotation + * @property {google.cloud.vision.v1.ISafeSearchAnnotation|null} [safeSearchAnnotation] AnnotateImageResponse safeSearchAnnotation + * @property {google.cloud.vision.v1.IImageProperties|null} [imagePropertiesAnnotation] AnnotateImageResponse imagePropertiesAnnotation + * @property {google.cloud.vision.v1.ICropHintsAnnotation|null} [cropHintsAnnotation] AnnotateImageResponse cropHintsAnnotation + * @property {google.cloud.vision.v1.IWebDetection|null} [webDetection] AnnotateImageResponse webDetection + * @property {google.cloud.vision.v1.IProductSearchResults|null} [productSearchResults] AnnotateImageResponse productSearchResults + * @property {google.rpc.IStatus|null} [error] AnnotateImageResponse error + * @property {google.cloud.vision.v1.IImageAnnotationContext|null} [context] AnnotateImageResponse context + */ + + /** + * Constructs a new AnnotateImageResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AnnotateImageResponse. + * @implements IAnnotateImageResponse + * @constructor + * @param {google.cloud.vision.v1.IAnnotateImageResponse=} [properties] Properties to set + */ + function AnnotateImageResponse(properties) { + this.faceAnnotations = []; + this.landmarkAnnotations = []; + this.logoAnnotations = []; + this.labelAnnotations = []; + this.localizedObjectAnnotations = []; + this.textAnnotations = []; + 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]]; + } + + /** + * AnnotateImageResponse faceAnnotations. + * @member {Array.} faceAnnotations + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.faceAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse landmarkAnnotations. + * @member {Array.} landmarkAnnotations + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.landmarkAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse logoAnnotations. + * @member {Array.} logoAnnotations + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.logoAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse labelAnnotations. + * @member {Array.} labelAnnotations + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.labelAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse localizedObjectAnnotations. + * @member {Array.} localizedObjectAnnotations + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.localizedObjectAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.textAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse fullTextAnnotation. + * @member {google.cloud.vision.v1.ITextAnnotation|null|undefined} fullTextAnnotation + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.fullTextAnnotation = null; + + /** + * AnnotateImageResponse safeSearchAnnotation. + * @member {google.cloud.vision.v1.ISafeSearchAnnotation|null|undefined} safeSearchAnnotation + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.safeSearchAnnotation = null; + + /** + * AnnotateImageResponse imagePropertiesAnnotation. + * @member {google.cloud.vision.v1.IImageProperties|null|undefined} imagePropertiesAnnotation + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.imagePropertiesAnnotation = null; + + /** + * AnnotateImageResponse cropHintsAnnotation. + * @member {google.cloud.vision.v1.ICropHintsAnnotation|null|undefined} cropHintsAnnotation + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.cropHintsAnnotation = null; + + /** + * AnnotateImageResponse webDetection. + * @member {google.cloud.vision.v1.IWebDetection|null|undefined} webDetection + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.webDetection = null; + + /** + * AnnotateImageResponse productSearchResults. + * @member {google.cloud.vision.v1.IProductSearchResults|null|undefined} productSearchResults + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.productSearchResults = null; + + /** + * AnnotateImageResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.error = null; + + /** + * AnnotateImageResponse context. + * @member {google.cloud.vision.v1.IImageAnnotationContext|null|undefined} context + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.context = null; + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1.IAnnotateImageResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AnnotateImageResponse} AnnotateImageResponse instance + */ + AnnotateImageResponse.create = function create(properties) { + return new AnnotateImageResponse(properties); + }; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faceAnnotations != null && message.faceAnnotations.length) + for (var i = 0; i < message.faceAnnotations.length; ++i) + $root.google.cloud.vision.v1.FaceAnnotation.encode(message.faceAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.landmarkAnnotations != null && message.landmarkAnnotations.length) + for (var i = 0; i < message.landmarkAnnotations.length; ++i) + $root.google.cloud.vision.v1.EntityAnnotation.encode(message.landmarkAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.logoAnnotations != null && message.logoAnnotations.length) + for (var i = 0; i < message.logoAnnotations.length; ++i) + $root.google.cloud.vision.v1.EntityAnnotation.encode(message.logoAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labelAnnotations != null && message.labelAnnotations.length) + for (var i = 0; i < message.labelAnnotations.length; ++i) + $root.google.cloud.vision.v1.EntityAnnotation.encode(message.labelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.vision.v1.EntityAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + $root.google.cloud.vision.v1.SafeSearchAnnotation.encode(message.safeSearchAnnotation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + $root.google.cloud.vision.v1.ImageProperties.encode(message.imagePropertiesAnnotation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + $root.google.cloud.vision.v1.CropHintsAnnotation.encode(message.cropHintsAnnotation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + $root.google.cloud.vision.v1.TextAnnotation.encode(message.fullTextAnnotation, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + $root.google.cloud.vision.v1.WebDetection.encode(message.webDetection, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) + $root.google.cloud.vision.v1.ProductSearchResults.encode(message.productSearchResults, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.context != null && message.hasOwnProperty("context")) + $root.google.cloud.vision.v1.ImageAnnotationContext.encode(message.context, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.localizedObjectAnnotations != null && message.localizedObjectAnnotations.length) + for (var i = 0; i < message.localizedObjectAnnotations.length; ++i) + $root.google.cloud.vision.v1.LocalizedObjectAnnotation.encode(message.localizedObjectAnnotations[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateImageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.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.vision.v1.AnnotateImageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.faceAnnotations && message.faceAnnotations.length)) + message.faceAnnotations = []; + message.faceAnnotations.push($root.google.cloud.vision.v1.FaceAnnotation.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.landmarkAnnotations && message.landmarkAnnotations.length)) + message.landmarkAnnotations = []; + message.landmarkAnnotations.push($root.google.cloud.vision.v1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.logoAnnotations && message.logoAnnotations.length)) + message.logoAnnotations = []; + message.logoAnnotations.push($root.google.cloud.vision.v1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.labelAnnotations && message.labelAnnotations.length)) + message.labelAnnotations = []; + message.labelAnnotations.push($root.google.cloud.vision.v1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 22: + if (!(message.localizedObjectAnnotations && message.localizedObjectAnnotations.length)) + message.localizedObjectAnnotations = []; + message.localizedObjectAnnotations.push($root.google.cloud.vision.v1.LocalizedObjectAnnotation.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.vision.v1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 12: + message.fullTextAnnotation = $root.google.cloud.vision.v1.TextAnnotation.decode(reader, reader.uint32()); + break; + case 6: + message.safeSearchAnnotation = $root.google.cloud.vision.v1.SafeSearchAnnotation.decode(reader, reader.uint32()); + break; + case 8: + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1.ImageProperties.decode(reader, reader.uint32()); + break; + case 11: + message.cropHintsAnnotation = $root.google.cloud.vision.v1.CropHintsAnnotation.decode(reader, reader.uint32()); + break; + case 13: + message.webDetection = $root.google.cloud.vision.v1.WebDetection.decode(reader, reader.uint32()); + break; + case 14: + message.productSearchResults = $root.google.cloud.vision.v1.ProductSearchResults.decode(reader, reader.uint32()); + break; + case 9: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 21: + message.context = $root.google.cloud.vision.v1.ImageAnnotationContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageResponse message. + * @function verify + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faceAnnotations != null && message.hasOwnProperty("faceAnnotations")) { + if (!Array.isArray(message.faceAnnotations)) + return "faceAnnotations: array expected"; + for (var i = 0; i < message.faceAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1.FaceAnnotation.verify(message.faceAnnotations[i]); + if (error) + return "faceAnnotations." + error; + } + } + if (message.landmarkAnnotations != null && message.hasOwnProperty("landmarkAnnotations")) { + if (!Array.isArray(message.landmarkAnnotations)) + return "landmarkAnnotations: array expected"; + for (var i = 0; i < message.landmarkAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1.EntityAnnotation.verify(message.landmarkAnnotations[i]); + if (error) + return "landmarkAnnotations." + error; + } + } + if (message.logoAnnotations != null && message.hasOwnProperty("logoAnnotations")) { + if (!Array.isArray(message.logoAnnotations)) + return "logoAnnotations: array expected"; + for (var i = 0; i < message.logoAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1.EntityAnnotation.verify(message.logoAnnotations[i]); + if (error) + return "logoAnnotations." + error; + } + } + if (message.labelAnnotations != null && message.hasOwnProperty("labelAnnotations")) { + if (!Array.isArray(message.labelAnnotations)) + return "labelAnnotations: array expected"; + for (var i = 0; i < message.labelAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1.EntityAnnotation.verify(message.labelAnnotations[i]); + if (error) + return "labelAnnotations." + error; + } + } + if (message.localizedObjectAnnotations != null && message.hasOwnProperty("localizedObjectAnnotations")) { + if (!Array.isArray(message.localizedObjectAnnotations)) + return "localizedObjectAnnotations: array expected"; + for (var i = 0; i < message.localizedObjectAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1.LocalizedObjectAnnotation.verify(message.localizedObjectAnnotations[i]); + if (error) + return "localizedObjectAnnotations." + error; + } + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1.EntityAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) { + var error = $root.google.cloud.vision.v1.TextAnnotation.verify(message.fullTextAnnotation); + if (error) + return "fullTextAnnotation." + error; + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) { + var error = $root.google.cloud.vision.v1.SafeSearchAnnotation.verify(message.safeSearchAnnotation); + if (error) + return "safeSearchAnnotation." + error; + } + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) { + var error = $root.google.cloud.vision.v1.ImageProperties.verify(message.imagePropertiesAnnotation); + if (error) + return "imagePropertiesAnnotation." + error; + } + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) { + var error = $root.google.cloud.vision.v1.CropHintsAnnotation.verify(message.cropHintsAnnotation); + if (error) + return "cropHintsAnnotation." + error; + } + if (message.webDetection != null && message.hasOwnProperty("webDetection")) { + var error = $root.google.cloud.vision.v1.WebDetection.verify(message.webDetection); + if (error) + return "webDetection." + error; + } + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) { + var error = $root.google.cloud.vision.v1.ProductSearchResults.verify(message.productSearchResults); + if (error) + return "productSearchResults." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.vision.v1.ImageAnnotationContext.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AnnotateImageResponse} AnnotateImageResponse + */ + AnnotateImageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AnnotateImageResponse) + return object; + var message = new $root.google.cloud.vision.v1.AnnotateImageResponse(); + if (object.faceAnnotations) { + if (!Array.isArray(object.faceAnnotations)) + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.faceAnnotations: array expected"); + message.faceAnnotations = []; + for (var i = 0; i < object.faceAnnotations.length; ++i) { + if (typeof object.faceAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.faceAnnotations: object expected"); + message.faceAnnotations[i] = $root.google.cloud.vision.v1.FaceAnnotation.fromObject(object.faceAnnotations[i]); + } + } + if (object.landmarkAnnotations) { + if (!Array.isArray(object.landmarkAnnotations)) + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.landmarkAnnotations: array expected"); + message.landmarkAnnotations = []; + for (var i = 0; i < object.landmarkAnnotations.length; ++i) { + if (typeof object.landmarkAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.landmarkAnnotations: object expected"); + message.landmarkAnnotations[i] = $root.google.cloud.vision.v1.EntityAnnotation.fromObject(object.landmarkAnnotations[i]); + } + } + if (object.logoAnnotations) { + if (!Array.isArray(object.logoAnnotations)) + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.logoAnnotations: array expected"); + message.logoAnnotations = []; + for (var i = 0; i < object.logoAnnotations.length; ++i) { + if (typeof object.logoAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.logoAnnotations: object expected"); + message.logoAnnotations[i] = $root.google.cloud.vision.v1.EntityAnnotation.fromObject(object.logoAnnotations[i]); + } + } + if (object.labelAnnotations) { + if (!Array.isArray(object.labelAnnotations)) + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.labelAnnotations: array expected"); + message.labelAnnotations = []; + for (var i = 0; i < object.labelAnnotations.length; ++i) { + if (typeof object.labelAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.labelAnnotations: object expected"); + message.labelAnnotations[i] = $root.google.cloud.vision.v1.EntityAnnotation.fromObject(object.labelAnnotations[i]); + } + } + if (object.localizedObjectAnnotations) { + if (!Array.isArray(object.localizedObjectAnnotations)) + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.localizedObjectAnnotations: array expected"); + message.localizedObjectAnnotations = []; + for (var i = 0; i < object.localizedObjectAnnotations.length; ++i) { + if (typeof object.localizedObjectAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.localizedObjectAnnotations: object expected"); + message.localizedObjectAnnotations[i] = $root.google.cloud.vision.v1.LocalizedObjectAnnotation.fromObject(object.localizedObjectAnnotations[i]); + } + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.vision.v1.EntityAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.fullTextAnnotation != null) { + if (typeof object.fullTextAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.fullTextAnnotation: object expected"); + message.fullTextAnnotation = $root.google.cloud.vision.v1.TextAnnotation.fromObject(object.fullTextAnnotation); + } + if (object.safeSearchAnnotation != null) { + if (typeof object.safeSearchAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.safeSearchAnnotation: object expected"); + message.safeSearchAnnotation = $root.google.cloud.vision.v1.SafeSearchAnnotation.fromObject(object.safeSearchAnnotation); + } + if (object.imagePropertiesAnnotation != null) { + if (typeof object.imagePropertiesAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.imagePropertiesAnnotation: object expected"); + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1.ImageProperties.fromObject(object.imagePropertiesAnnotation); + } + if (object.cropHintsAnnotation != null) { + if (typeof object.cropHintsAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.cropHintsAnnotation: object expected"); + message.cropHintsAnnotation = $root.google.cloud.vision.v1.CropHintsAnnotation.fromObject(object.cropHintsAnnotation); + } + if (object.webDetection != null) { + if (typeof object.webDetection !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.webDetection: object expected"); + message.webDetection = $root.google.cloud.vision.v1.WebDetection.fromObject(object.webDetection); + } + if (object.productSearchResults != null) { + if (typeof object.productSearchResults !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.productSearchResults: object expected"); + message.productSearchResults = $root.google.cloud.vision.v1.ProductSearchResults.fromObject(object.productSearchResults); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateImageResponse.context: object expected"); + message.context = $root.google.cloud.vision.v1.ImageAnnotationContext.fromObject(object.context); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1.AnnotateImageResponse} message AnnotateImageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.faceAnnotations = []; + object.landmarkAnnotations = []; + object.logoAnnotations = []; + object.labelAnnotations = []; + object.textAnnotations = []; + object.localizedObjectAnnotations = []; + } + if (options.defaults) { + object.safeSearchAnnotation = null; + object.imagePropertiesAnnotation = null; + object.error = null; + object.cropHintsAnnotation = null; + object.fullTextAnnotation = null; + object.webDetection = null; + object.productSearchResults = null; + object.context = null; + } + if (message.faceAnnotations && message.faceAnnotations.length) { + object.faceAnnotations = []; + for (var j = 0; j < message.faceAnnotations.length; ++j) + object.faceAnnotations[j] = $root.google.cloud.vision.v1.FaceAnnotation.toObject(message.faceAnnotations[j], options); + } + if (message.landmarkAnnotations && message.landmarkAnnotations.length) { + object.landmarkAnnotations = []; + for (var j = 0; j < message.landmarkAnnotations.length; ++j) + object.landmarkAnnotations[j] = $root.google.cloud.vision.v1.EntityAnnotation.toObject(message.landmarkAnnotations[j], options); + } + if (message.logoAnnotations && message.logoAnnotations.length) { + object.logoAnnotations = []; + for (var j = 0; j < message.logoAnnotations.length; ++j) + object.logoAnnotations[j] = $root.google.cloud.vision.v1.EntityAnnotation.toObject(message.logoAnnotations[j], options); + } + if (message.labelAnnotations && message.labelAnnotations.length) { + object.labelAnnotations = []; + for (var j = 0; j < message.labelAnnotations.length; ++j) + object.labelAnnotations[j] = $root.google.cloud.vision.v1.EntityAnnotation.toObject(message.labelAnnotations[j], options); + } + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.vision.v1.EntityAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + object.safeSearchAnnotation = $root.google.cloud.vision.v1.SafeSearchAnnotation.toObject(message.safeSearchAnnotation, options); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + object.imagePropertiesAnnotation = $root.google.cloud.vision.v1.ImageProperties.toObject(message.imagePropertiesAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + object.cropHintsAnnotation = $root.google.cloud.vision.v1.CropHintsAnnotation.toObject(message.cropHintsAnnotation, options); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + object.fullTextAnnotation = $root.google.cloud.vision.v1.TextAnnotation.toObject(message.fullTextAnnotation, options); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + object.webDetection = $root.google.cloud.vision.v1.WebDetection.toObject(message.webDetection, options); + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) + object.productSearchResults = $root.google.cloud.vision.v1.ProductSearchResults.toObject(message.productSearchResults, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.vision.v1.ImageAnnotationContext.toObject(message.context, options); + if (message.localizedObjectAnnotations && message.localizedObjectAnnotations.length) { + object.localizedObjectAnnotations = []; + for (var j = 0; j < message.localizedObjectAnnotations.length; ++j) + object.localizedObjectAnnotations[j] = $root.google.cloud.vision.v1.LocalizedObjectAnnotation.toObject(message.localizedObjectAnnotations[j], options); + } + return object; + }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AnnotateImageResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageResponse; + })(); + + v1.BatchAnnotateImagesRequest = (function() { + + /** + * Properties of a BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1 + * @interface IBatchAnnotateImagesRequest + * @property {Array.|null} [requests] BatchAnnotateImagesRequest requests + * @property {string|null} [parent] BatchAnnotateImagesRequest parent + */ + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a BatchAnnotateImagesRequest. + * @implements IBatchAnnotateImagesRequest + * @constructor + * @param {google.cloud.vision.v1.IBatchAnnotateImagesRequest=} [properties] Properties to set + */ + function BatchAnnotateImagesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchAnnotateImagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @instance + */ + BatchAnnotateImagesRequest.prototype.requests = $util.emptyArray; + + /** + * BatchAnnotateImagesRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @instance + */ + BatchAnnotateImagesRequest.prototype.parent = ""; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest instance + */ + BatchAnnotateImagesRequest.create = function create(properties) { + return new BatchAnnotateImagesRequest(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1.AnnotateImageRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.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.vision.v1.BatchAnnotateImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1.AnnotateImageRequest.decode(reader, reader.uint32())); + break; + case 4: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1.AnnotateImageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + */ + BatchAnnotateImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.BatchAnnotateImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1.BatchAnnotateImagesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1.BatchAnnotateImagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1.BatchAnnotateImagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1.AnnotateImageRequest.fromObject(object.requests[i]); + } + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.BatchAnnotateImagesRequest} message BatchAnnotateImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1.AnnotateImageRequest.toObject(message.requests[j], options); + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.BatchAnnotateImagesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesRequest; + })(); + + v1.BatchAnnotateImagesResponse = (function() { + + /** + * Properties of a BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1 + * @interface IBatchAnnotateImagesResponse + * @property {Array.|null} [responses] BatchAnnotateImagesResponse responses + */ + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a BatchAnnotateImagesResponse. + * @implements IBatchAnnotateImagesResponse + * @constructor + * @param {google.cloud.vision.v1.IBatchAnnotateImagesResponse=} [properties] Properties to set + */ + function BatchAnnotateImagesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * BatchAnnotateImagesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @instance + */ + BatchAnnotateImagesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse instance + */ + BatchAnnotateImagesResponse.create = function create(properties) { + return new BatchAnnotateImagesResponse(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.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.vision.v1.BatchAnnotateImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + */ + BatchAnnotateImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.BatchAnnotateImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1.BatchAnnotateImagesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1.BatchAnnotateImagesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1.BatchAnnotateImagesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.BatchAnnotateImagesResponse} message BatchAnnotateImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1.AnnotateImageResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.BatchAnnotateImagesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesResponse; + })(); + + v1.AnnotateFileRequest = (function() { + + /** + * Properties of an AnnotateFileRequest. + * @memberof google.cloud.vision.v1 + * @interface IAnnotateFileRequest + * @property {google.cloud.vision.v1.IInputConfig|null} [inputConfig] AnnotateFileRequest inputConfig + * @property {Array.|null} [features] AnnotateFileRequest features + * @property {google.cloud.vision.v1.IImageContext|null} [imageContext] AnnotateFileRequest imageContext + * @property {Array.|null} [pages] AnnotateFileRequest pages + */ + + /** + * Constructs a new AnnotateFileRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AnnotateFileRequest. + * @implements IAnnotateFileRequest + * @constructor + * @param {google.cloud.vision.v1.IAnnotateFileRequest=} [properties] Properties to set + */ + function AnnotateFileRequest(properties) { + this.features = []; + this.pages = []; + 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]]; + } + + /** + * AnnotateFileRequest inputConfig. + * @member {google.cloud.vision.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.inputConfig = null; + + /** + * AnnotateFileRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateFileRequest imageContext. + * @member {google.cloud.vision.v1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.imageContext = null; + + /** + * AnnotateFileRequest pages. + * @member {Array.} pages + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.pages = $util.emptyArray; + + /** + * Creates a new AnnotateFileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.IAnnotateFileRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AnnotateFileRequest} AnnotateFileRequest instance + */ + AnnotateFileRequest.create = function create(properties) { + return new AnnotateFileRequest(properties); + }; + + /** + * Encodes the specified AnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.IAnnotateFileRequest} message AnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pages != null && message.pages.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.pages.length; ++i) + writer.int32(message.pages[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.IAnnotateFileRequest} message AnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AnnotateFileRequest} AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileRequest.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.vision.v1.AnnotateFileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1.ImageContext.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.pages && message.pages.length)) + message.pages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.pages.push(reader.int32()); + } else + message.pages.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AnnotateFileRequest} AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateFileRequest message. + * @function verify + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateFileRequest.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.vision.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) + if (!$util.isInteger(message.pages[i])) + return "pages: integer[] expected"; + } + return null; + }; + + /** + * Creates an AnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AnnotateFileRequest} AnnotateFileRequest + */ + AnnotateFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AnnotateFileRequest) + return object; + var message = new $root.google.cloud.vision.v1.AnnotateFileRequest(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateFileRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1.InputConfig.fromObject(object.inputConfig); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1.AnnotateFileRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateFileRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateFileRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1.ImageContext.fromObject(object.imageContext); + } + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.vision.v1.AnnotateFileRequest.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) + message.pages[i] = object.pages[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an AnnotateFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.AnnotateFileRequest} message AnnotateFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateFileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.features = []; + object.pages = []; + } + if (options.defaults) { + object.inputConfig = null; + object.imageContext = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1.InputConfig.toObject(message.inputConfig, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1.ImageContext.toObject(message.imageContext, options); + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = message.pages[j]; + } + return object; + }; + + /** + * Converts this AnnotateFileRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AnnotateFileRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateFileRequest; + })(); + + v1.AnnotateFileResponse = (function() { + + /** + * Properties of an AnnotateFileResponse. + * @memberof google.cloud.vision.v1 + * @interface IAnnotateFileResponse + * @property {google.cloud.vision.v1.IInputConfig|null} [inputConfig] AnnotateFileResponse inputConfig + * @property {Array.|null} [responses] AnnotateFileResponse responses + * @property {number|null} [totalPages] AnnotateFileResponse totalPages + * @property {google.rpc.IStatus|null} [error] AnnotateFileResponse error + */ + + /** + * Constructs a new AnnotateFileResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AnnotateFileResponse. + * @implements IAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1.IAnnotateFileResponse=} [properties] Properties to set + */ + function AnnotateFileResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AnnotateFileResponse inputConfig. + * @member {google.cloud.vision.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.inputConfig = null; + + /** + * AnnotateFileResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.responses = $util.emptyArray; + + /** + * AnnotateFileResponse totalPages. + * @member {number} totalPages + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.totalPages = 0; + + /** + * AnnotateFileResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.error = null; + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.IAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AnnotateFileResponse} AnnotateFileResponse instance + */ + AnnotateFileResponse.create = function create(properties) { + return new AnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalPages); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.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.vision.v1.AnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + case 3: + message.totalPages = reader.int32(); + break; + case 4: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateFileResponse.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.vision.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (!$util.isInteger(message.totalPages)) + return "totalPages: integer expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + return null; + }; + + /** + * Creates an AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AnnotateFileResponse} AnnotateFileResponse + */ + AnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1.AnnotateFileResponse(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateFileResponse.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1.InputConfig.fromObject(object.inputConfig); + } + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1.AnnotateFileResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateFileResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + if (object.totalPages != null) + message.totalPages = object.totalPages | 0; + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vision.v1.AnnotateFileResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.AnnotateFileResponse} message AnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (options.defaults) { + object.inputConfig = null; + object.totalPages = 0; + object.error = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1.InputConfig.toObject(message.inputConfig, options); + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1.AnnotateImageResponse.toObject(message.responses[j], options); + } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + object.totalPages = message.totalPages; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateFileResponse; + })(); + + v1.BatchAnnotateFilesRequest = (function() { + + /** + * Properties of a BatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1 + * @interface IBatchAnnotateFilesRequest + * @property {Array.|null} [requests] BatchAnnotateFilesRequest requests + * @property {string|null} [parent] BatchAnnotateFilesRequest parent + */ + + /** + * Constructs a new BatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a BatchAnnotateFilesRequest. + * @implements IBatchAnnotateFilesRequest + * @constructor + * @param {google.cloud.vision.v1.IBatchAnnotateFilesRequest=} [properties] Properties to set + */ + function BatchAnnotateFilesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchAnnotateFilesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @instance + */ + BatchAnnotateFilesRequest.prototype.requests = $util.emptyArray; + + /** + * BatchAnnotateFilesRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @instance + */ + BatchAnnotateFilesRequest.prototype.parent = ""; + + /** + * Creates a new BatchAnnotateFilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateFilesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest instance + */ + BatchAnnotateFilesRequest.create = function create(properties) { + return new BatchAnnotateFilesRequest(properties); + }; + + /** + * Encodes the specified BatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateFilesRequest} message BatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1.AnnotateFileRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateFilesRequest} message BatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesRequest.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.vision.v1.BatchAnnotateFilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1.AnnotateFileRequest.decode(reader, reader.uint32())); + break; + case 3: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateFilesRequest message. + * @function verify + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateFilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1.AnnotateFileRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a BatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest + */ + BatchAnnotateFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.BatchAnnotateFilesRequest) + return object; + var message = new $root.google.cloud.vision.v1.BatchAnnotateFilesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1.BatchAnnotateFilesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1.BatchAnnotateFilesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1.AnnotateFileRequest.fromObject(object.requests[i]); + } + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.BatchAnnotateFilesRequest} message BatchAnnotateFilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateFilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1.AnnotateFileRequest.toObject(message.requests[j], options); + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this BatchAnnotateFilesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.BatchAnnotateFilesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateFilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateFilesRequest; + })(); + + v1.BatchAnnotateFilesResponse = (function() { + + /** + * Properties of a BatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1 + * @interface IBatchAnnotateFilesResponse + * @property {Array.|null} [responses] BatchAnnotateFilesResponse responses + */ + + /** + * Constructs a new BatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a BatchAnnotateFilesResponse. + * @implements IBatchAnnotateFilesResponse + * @constructor + * @param {google.cloud.vision.v1.IBatchAnnotateFilesResponse=} [properties] Properties to set + */ + function BatchAnnotateFilesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * BatchAnnotateFilesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @instance + */ + BatchAnnotateFilesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new BatchAnnotateFilesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateFilesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse instance + */ + BatchAnnotateFilesResponse.create = function create(properties) { + return new BatchAnnotateFilesResponse(properties); + }; + + /** + * Encodes the specified BatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateFilesResponse} message BatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1.AnnotateFileResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchAnnotateFilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.IBatchAnnotateFilesResponse} message BatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesResponse.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.vision.v1.BatchAnnotateFilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1.AnnotateFileResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateFilesResponse message. + * @function verify + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateFilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1.AnnotateFileResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse + */ + BatchAnnotateFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.BatchAnnotateFilesResponse) + return object; + var message = new $root.google.cloud.vision.v1.BatchAnnotateFilesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1.BatchAnnotateFilesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1.BatchAnnotateFilesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1.AnnotateFileResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.BatchAnnotateFilesResponse} message BatchAnnotateFilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateFilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1.AnnotateFileResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateFilesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.BatchAnnotateFilesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateFilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateFilesResponse; + })(); + + v1.AsyncAnnotateFileRequest = (function() { + + /** + * Properties of an AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1 + * @interface IAsyncAnnotateFileRequest + * @property {google.cloud.vision.v1.IInputConfig|null} [inputConfig] AsyncAnnotateFileRequest inputConfig + * @property {Array.|null} [features] AsyncAnnotateFileRequest features + * @property {google.cloud.vision.v1.IImageContext|null} [imageContext] AsyncAnnotateFileRequest imageContext + * @property {google.cloud.vision.v1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileRequest outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AsyncAnnotateFileRequest. + * @implements IAsyncAnnotateFileRequest + * @constructor + * @param {google.cloud.vision.v1.IAsyncAnnotateFileRequest=} [properties] Properties to set + */ + function AsyncAnnotateFileRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AsyncAnnotateFileRequest inputConfig. + * @member {google.cloud.vision.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.inputConfig = null; + + /** + * AsyncAnnotateFileRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.features = $util.emptyArray; + + /** + * AsyncAnnotateFileRequest imageContext. + * @member {google.cloud.vision.v1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.imageContext = null; + + /** + * AsyncAnnotateFileRequest outputConfig. + * @member {google.cloud.vision.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.IAsyncAnnotateFileRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest instance + */ + AsyncAnnotateFileRequest.create = function create(properties) { + return new AsyncAnnotateFileRequest(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.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.vision.v1.AsyncAnnotateFileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1.ImageContext.decode(reader, reader.uint32()); + break; + case 4: + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @function verify + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileRequest.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.vision.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + */ + AsyncAnnotateFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AsyncAnnotateFileRequest) + return object; + var message = new $root.google.cloud.vision.v1.AsyncAnnotateFileRequest(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncAnnotateFileRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1.InputConfig.fromObject(object.inputConfig); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1.AsyncAnnotateFileRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncAnnotateFileRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncAnnotateFileRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1.ImageContext.fromObject(object.imageContext); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncAnnotateFileRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1.AsyncAnnotateFileRequest} message AsyncAnnotateFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputConfig = null; + object.imageContext = null; + object.outputConfig = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1.InputConfig.toObject(message.inputConfig, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1.ImageContext.toObject(message.imageContext, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AsyncAnnotateFileRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileRequest; + })(); + + v1.AsyncAnnotateFileResponse = (function() { + + /** + * Properties of an AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1 + * @interface IAsyncAnnotateFileResponse + * @property {google.cloud.vision.v1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileResponse outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AsyncAnnotateFileResponse. + * @implements IAsyncAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1.IAsyncAnnotateFileResponse=} [properties] Properties to set + */ + function AsyncAnnotateFileResponse(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]]; + } + + /** + * AsyncAnnotateFileResponse outputConfig. + * @member {google.cloud.vision.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @instance + */ + AsyncAnnotateFileResponse.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.IAsyncAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse instance + */ + AsyncAnnotateFileResponse.create = function create(properties) { + return new AsyncAnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.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.vision.v1.AsyncAnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + */ + AsyncAnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AsyncAnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1.AsyncAnnotateFileResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncAnnotateFileResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1.AsyncAnnotateFileResponse} message AsyncAnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AsyncAnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileResponse; + })(); + + v1.AsyncBatchAnnotateImagesRequest = (function() { + + /** + * Properties of an AsyncBatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1 + * @interface IAsyncBatchAnnotateImagesRequest + * @property {Array.|null} [requests] AsyncBatchAnnotateImagesRequest requests + * @property {google.cloud.vision.v1.IOutputConfig|null} [outputConfig] AsyncBatchAnnotateImagesRequest outputConfig + * @property {string|null} [parent] AsyncBatchAnnotateImagesRequest parent + */ + + /** + * Constructs a new AsyncBatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AsyncBatchAnnotateImagesRequest. + * @implements IAsyncBatchAnnotateImagesRequest + * @constructor + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest=} [properties] Properties to set + */ + function AsyncBatchAnnotateImagesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * AsyncBatchAnnotateImagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @instance + */ + AsyncBatchAnnotateImagesRequest.prototype.requests = $util.emptyArray; + + /** + * AsyncBatchAnnotateImagesRequest outputConfig. + * @member {google.cloud.vision.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @instance + */ + AsyncBatchAnnotateImagesRequest.prototype.outputConfig = null; + + /** + * AsyncBatchAnnotateImagesRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @instance + */ + AsyncBatchAnnotateImagesRequest.prototype.parent = ""; + + /** + * Creates a new AsyncBatchAnnotateImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest instance + */ + AsyncBatchAnnotateImagesRequest.create = function create(properties) { + return new AsyncBatchAnnotateImagesRequest(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest} message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1.AnnotateImageRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesRequest} message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesRequest.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.vision.v1.AsyncBatchAnnotateImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1.AnnotateImageRequest.decode(reader, reader.uint32())); + break; + case 2: + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.decode(reader, reader.uint32()); + break; + case 4: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1.AnnotateImageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates an AsyncBatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest + */ + AsyncBatchAnnotateImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1.AnnotateImageRequest.fromObject(object.requests[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.fromObject(object.outputConfig); + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest} message AsyncBatchAnnotateImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) { + object.outputConfig = null; + object.parent = ""; + } + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1.AnnotateImageRequest.toObject(message.requests[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this AsyncBatchAnnotateImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateImagesRequest; + })(); + + v1.AsyncBatchAnnotateImagesResponse = (function() { + + /** + * Properties of an AsyncBatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1 + * @interface IAsyncBatchAnnotateImagesResponse + * @property {google.cloud.vision.v1.IOutputConfig|null} [outputConfig] AsyncBatchAnnotateImagesResponse outputConfig + */ + + /** + * Constructs a new AsyncBatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AsyncBatchAnnotateImagesResponse. + * @implements IAsyncBatchAnnotateImagesResponse + * @constructor + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse=} [properties] Properties to set + */ + function AsyncBatchAnnotateImagesResponse(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]]; + } + + /** + * AsyncBatchAnnotateImagesResponse outputConfig. + * @member {google.cloud.vision.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @instance + */ + AsyncBatchAnnotateImagesResponse.prototype.outputConfig = null; + + /** + * Creates a new AsyncBatchAnnotateImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse instance + */ + AsyncBatchAnnotateImagesResponse.create = function create(properties) { + return new AsyncBatchAnnotateImagesResponse(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse} message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateImagesResponse} message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesResponse.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.vision.v1.AsyncBatchAnnotateImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse + */ + AsyncBatchAnnotateImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse} message AsyncBatchAnnotateImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncBatchAnnotateImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateImagesResponse; + })(); + + v1.AsyncBatchAnnotateFilesRequest = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1 + * @interface IAsyncBatchAnnotateFilesRequest + * @property {Array.|null} [requests] AsyncBatchAnnotateFilesRequest requests + * @property {string|null} [parent] AsyncBatchAnnotateFilesRequest parent + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AsyncBatchAnnotateFilesRequest. + * @implements IAsyncBatchAnnotateFilesRequest + * @constructor + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @instance + */ + AsyncBatchAnnotateFilesRequest.prototype.requests = $util.emptyArray; + + /** + * AsyncBatchAnnotateFilesRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @instance + */ + AsyncBatchAnnotateFilesRequest.prototype.parent = ""; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest instance + */ + AsyncBatchAnnotateFilesRequest.create = function create(properties) { + return new AsyncBatchAnnotateFilesRequest(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1.AsyncAnnotateFileRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.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.vision.v1.AsyncBatchAnnotateFilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1.AsyncAnnotateFileRequest.decode(reader, reader.uint32())); + break; + case 4: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @function verify + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1.AsyncAnnotateFileRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + */ + AsyncBatchAnnotateFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest) + return object; + var message = new $root.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1.AsyncAnnotateFileRequest.fromObject(object.requests[i]); + } + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1.AsyncAnnotateFileRequest.toObject(message.requests[j], options); + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesRequest; + })(); + + v1.AsyncBatchAnnotateFilesResponse = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1 + * @interface IAsyncBatchAnnotateFilesResponse + * @property {Array.|null} [responses] AsyncBatchAnnotateFilesResponse responses + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AsyncBatchAnnotateFilesResponse. + * @implements IAsyncBatchAnnotateFilesResponse + * @constructor + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @instance + */ + AsyncBatchAnnotateFilesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse instance + */ + AsyncBatchAnnotateFilesResponse.create = function create(properties) { + return new AsyncBatchAnnotateFilesResponse(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1.AsyncAnnotateFileResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.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.vision.v1.AsyncBatchAnnotateFilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1.AsyncAnnotateFileResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @function verify + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1.AsyncAnnotateFileResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + */ + AsyncBatchAnnotateFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse) + return object; + var message = new $root.google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1.AsyncAnnotateFileResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1.AsyncAnnotateFileResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesResponse; + })(); + + v1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.vision.v1 + * @interface IInputConfig + * @property {google.cloud.vision.v1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {Uint8Array|null} [content] InputConfig content + * @property {string|null} [mimeType] InputConfig mimeType + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.vision.v1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(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]]; + } + + /** + * InputConfig gcsSource. + * @member {google.cloud.vision.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.vision.v1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig content. + * @member {Uint8Array} content + * @memberof google.cloud.vision.v1.InputConfig + * @instance + */ + InputConfig.prototype.content = $util.newBuffer([]); + + /** + * InputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.vision.v1.InputConfig + * @instance + */ + InputConfig.prototype.mimeType = ""; + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.InputConfig + * @static + * @param {google.cloud.vision.v1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.v1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.InputConfig + * @static + * @param {google.cloud.vision.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.vision.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.InputConfig + * @static + * @param {google.cloud.vision.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.vision.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.vision.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.vision.v1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.vision.v1.GcsSource.decode(reader, reader.uint32()); + break; + case 3: + message.content = reader.bytes(); + break; + case 2: + message.mimeType = 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.vision.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.vision.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"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.vision.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: 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.vision.v1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.InputConfig) + return object; + var message = new $root.google.cloud.vision.v1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.vision.v1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.vision.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.InputConfig + * @static + * @param {google.cloud.vision.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.defaults) { + object.gcsSource = null; + object.mimeType = ""; + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.vision.v1.GcsSource.toObject(message.gcsSource, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputConfig; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.vision.v1 + * @interface IOutputConfig + * @property {google.cloud.vision.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {number|null} [batchSize] OutputConfig batchSize + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.vision.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.vision.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.vision.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig batchSize. + * @member {number} batchSize + * @memberof google.cloud.vision.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.batchSize = 0; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.OutputConfig + * @static + * @param {google.cloud.vision.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.OutputConfig + * @static + * @param {google.cloud.vision.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.vision.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.batchSize); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.OutputConfig + * @static + * @param {google.cloud.vision.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.vision.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.vision.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.vision.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.vision.v1.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.batchSize = reader.int32(); + 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.vision.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.vision.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"; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + var error = $root.google.cloud.vision.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + if (!$util.isInteger(message.batchSize)) + return "batchSize: integer expected"; + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.OutputConfig) + return object; + var message = new $root.google.cloud.vision.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.vision.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.vision.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.batchSize != null) + message.batchSize = object.batchSize | 0; + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.OutputConfig + * @static + * @param {google.cloud.vision.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 (options.defaults) { + object.gcsDestination = null; + object.batchSize = 0; + } + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + object.gcsDestination = $root.google.cloud.vision.v1.GcsDestination.toObject(message.gcsDestination, options); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + object.batchSize = message.batchSize; + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.vision.v1 + * @interface IGcsSource + * @property {string|null} [uri] GcsSource uri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.vision.v1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(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]]; + } + + /** + * GcsSource uri. + * @member {string} uri + * @memberof google.cloud.vision.v1.GcsSource + * @instance + */ + GcsSource.prototype.uri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.GcsSource + * @static + * @param {google.cloud.vision.v1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.v1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.GcsSource + * @static + * @param {google.cloud.vision.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.GcsSource + * @static + * @param {google.cloud.vision.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.vision.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.vision.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.vision.v1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.vision.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.GcsSource) + return object; + var message = new $root.google.cloud.vision.v1.GcsSource(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.GcsSource + * @static + * @param {google.cloud.vision.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.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.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.vision.v1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.vision.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 uri. + * @member {string} uri + * @memberof google.cloud.vision.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.GcsDestination + * @static + * @param {google.cloud.vision.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.vision.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.GcsDestination + * @static + * @param {google.cloud.vision.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.GcsDestination + * @static + * @param {google.cloud.vision.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.vision.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.vision.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.vision.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.vision.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.GcsDestination) + return object; + var message = new $root.google.cloud.vision.v1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.GcsDestination + * @static + * @param {google.cloud.vision.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.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.vision.v1 + * @interface IOperationMetadata + * @property {google.cloud.vision.v1.OperationMetadata.State|null} [state] OperationMetadata state + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.vision.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata state. + * @member {google.cloud.vision.v1.OperationMetadata.State} state + * @memberof google.cloud.vision.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.state = 0; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vision.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vision.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.OperationMetadata + * @static + * @param {google.cloud.vision.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vision.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.OperationMetadata + * @static + * @param {google.cloud.vision.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + 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.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.OperationMetadata + * @static + * @param {google.cloud.vision.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(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.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.vision.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.vision.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.vision.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"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.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; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.vision.v1.OperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATED": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vision.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.vision.v1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.OperationMetadata + * @static + * @param {google.cloud.vision.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vision.v1.OperationMetadata.State[message.state] : message.state; + 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); + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.vision.v1.OperationMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATED=1 CREATED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + * @property {number} CANCELLED=4 CANCELLED value + */ + OperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return OperationMetadata; + })(); + + v1.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.vision.v1 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.vision.v1.IVertex=} [properties] Properties to set + */ + function Vertex(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]]; + } + + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.vision.v1.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.vision.v1.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {google.cloud.vision.v1.IVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {google.cloud.vision.v1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && message.hasOwnProperty("x")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); + if (message.y != null && message.hasOwnProperty("y")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); + return writer; + }; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {google.cloud.vision.v1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.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.vision.v1.Vertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.int32(); + break; + case 2: + message.y = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vertex message. + * @function verify + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Vertex) + return object; + var message = new $root.google.cloud.vision.v1.Vertex(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Vertex + * @static + * @param {google.cloud.vision.v1.Vertex} message Vertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vertex.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 = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + + /** + * Converts this Vertex to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Vertex + * @instance + * @returns {Object.} JSON object + */ + Vertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vertex; + })(); + + v1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.vision.v1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.vision.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.vision.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.vision.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.v1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.NormalizedVertex + * @static + * @param {google.cloud.vision.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.vision.v1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.NormalizedVertex + * @static + * @param {google.cloud.vision.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.vision.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.vision.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.vision.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.vision.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.vision.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.vision.v1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.NormalizedVertex) + return object; + var message = new $root.google.cloud.vision.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.vision.v1.NormalizedVertex + * @static + * @param {google.cloud.vision.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.vision.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.vision.v1 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.vision.v1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.vertices = []; + 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 vertices. + * @member {Array.} vertices + * @memberof google.cloud.vision.v1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.vision.v1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.BoundingPoly + * @static + * @param {google.cloud.vision.v1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.vision.v1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.BoundingPoly + * @static + * @param {google.cloud.vision.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.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.vision.v1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.vision.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.vision.v1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.BoundingPoly + * @static + * @param {google.cloud.vision.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.vision.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.vision.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.vision.v1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.vision.v1.Vertex.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.vision.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.vision.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.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.vision.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.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.vision.v1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + 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.vision.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.vision.v1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.BoundingPoly) + return object; + var message = new $root.google.cloud.vision.v1.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.vision.v1.BoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.vision.v1.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.vision.v1.Vertex.fromObject(object.vertices[i]); + } + } + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.vision.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.vision.v1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.vision.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.vision.v1.BoundingPoly + * @static + * @param {google.cloud.vision.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.vertices = []; + object.normalizedVertices = []; + } + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.vision.v1.Vertex.toObject(message.vertices[j], options); + } + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.vision.v1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoundingPoly; + })(); + + v1.Position = (function() { + + /** + * Properties of a Position. + * @memberof google.cloud.vision.v1 + * @interface IPosition + * @property {number|null} [x] Position x + * @property {number|null} [y] Position y + * @property {number|null} [z] Position z + */ + + /** + * Constructs a new Position. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Position. + * @implements IPosition + * @constructor + * @param {google.cloud.vision.v1.IPosition=} [properties] Properties to set + */ + function Position(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]]; + } + + /** + * Position x. + * @member {number} x + * @memberof google.cloud.vision.v1.Position + * @instance + */ + Position.prototype.x = 0; + + /** + * Position y. + * @member {number} y + * @memberof google.cloud.vision.v1.Position + * @instance + */ + Position.prototype.y = 0; + + /** + * Position z. + * @member {number} z + * @memberof google.cloud.vision.v1.Position + * @instance + */ + Position.prototype.z = 0; + + /** + * Creates a new Position instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Position + * @static + * @param {google.cloud.vision.v1.IPosition=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Position} Position instance + */ + Position.create = function create(properties) { + return new Position(properties); + }; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1.Position.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Position + * @static + * @param {google.cloud.vision.v1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.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); + if (message.z != null && message.hasOwnProperty("z")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.z); + return writer; + }; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Position.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Position + * @static + * @param {google.cloud.vision.v1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Position message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.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.vision.v1.Position(); + 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; + case 3: + message.z = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Position message. + * @function verify + * @memberof google.cloud.vision.v1.Position + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Position.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"; + if (message.z != null && message.hasOwnProperty("z")) + if (typeof message.z !== "number") + return "z: number expected"; + return null; + }; + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Position + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Position} Position + */ + Position.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Position) + return object; + var message = new $root.google.cloud.vision.v1.Position(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + if (object.z != null) + message.z = Number(object.z); + return message; + }; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Position + * @static + * @param {google.cloud.vision.v1.Position} message Position + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Position.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + object.z = 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; + if (message.z != null && message.hasOwnProperty("z")) + object.z = options.json && !isFinite(message.z) ? String(message.z) : message.z; + return object; + }; + + /** + * Converts this Position to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Position + * @instance + * @returns {Object.} JSON object + */ + Position.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Position; + })(); + + v1.ProductSearchParams = (function() { + + /** + * Properties of a ProductSearchParams. + * @memberof google.cloud.vision.v1 + * @interface IProductSearchParams + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingPoly] ProductSearchParams boundingPoly + * @property {string|null} [productSet] ProductSearchParams productSet + * @property {Array.|null} [productCategories] ProductSearchParams productCategories + * @property {string|null} [filter] ProductSearchParams filter + */ + + /** + * Constructs a new ProductSearchParams. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ProductSearchParams. + * @implements IProductSearchParams + * @constructor + * @param {google.cloud.vision.v1.IProductSearchParams=} [properties] Properties to set + */ + function ProductSearchParams(properties) { + this.productCategories = []; + 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]]; + } + + /** + * ProductSearchParams boundingPoly. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.boundingPoly = null; + + /** + * ProductSearchParams productSet. + * @member {string} productSet + * @memberof google.cloud.vision.v1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.productSet = ""; + + /** + * ProductSearchParams productCategories. + * @member {Array.} productCategories + * @memberof google.cloud.vision.v1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.productCategories = $util.emptyArray; + + /** + * ProductSearchParams filter. + * @member {string} filter + * @memberof google.cloud.vision.v1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.filter = ""; + + /** + * Creates a new ProductSearchParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1.IProductSearchParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ProductSearchParams} ProductSearchParams instance + */ + ProductSearchParams.create = function create(properties) { + return new ProductSearchParams(properties); + }; + + /** + * Encodes the specified ProductSearchParams message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1.IProductSearchParams} message ProductSearchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSet != null && message.hasOwnProperty("productSet")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.productSet); + if (message.productCategories != null && message.productCategories.length) + for (var i = 0; i < message.productCategories.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.productCategories[i]); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSearchParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1.IProductSearchParams} message ProductSearchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ProductSearchParams} ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchParams.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.vision.v1.ProductSearchParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 6: + message.productSet = reader.string(); + break; + case 7: + if (!(message.productCategories && message.productCategories.length)) + message.productCategories = []; + message.productCategories.push(reader.string()); + break; + case 8: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ProductSearchParams} ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSearchParams message. + * @function verify + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSearchParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + if (!$util.isString(message.productSet)) + return "productSet: string expected"; + if (message.productCategories != null && message.hasOwnProperty("productCategories")) { + if (!Array.isArray(message.productCategories)) + return "productCategories: array expected"; + for (var i = 0; i < message.productCategories.length; ++i) + if (!$util.isString(message.productCategories[i])) + return "productCategories: string[] expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ProductSearchParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ProductSearchParams} ProductSearchParams + */ + ProductSearchParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ProductSearchParams) + return object; + var message = new $root.google.cloud.vision.v1.ProductSearchParams(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchParams.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.productSet != null) + message.productSet = String(object.productSet); + if (object.productCategories) { + if (!Array.isArray(object.productCategories)) + throw TypeError(".google.cloud.vision.v1.ProductSearchParams.productCategories: array expected"); + message.productCategories = []; + for (var i = 0; i < object.productCategories.length; ++i) + message.productCategories[i] = String(object.productCategories[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ProductSearchParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1.ProductSearchParams} message ProductSearchParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSearchParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productCategories = []; + if (options.defaults) { + object.productSet = ""; + object.filter = ""; + object.boundingPoly = null; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = message.productSet; + if (message.productCategories && message.productCategories.length) { + object.productCategories = []; + for (var j = 0; j < message.productCategories.length; ++j) + object.productCategories[j] = message.productCategories[j]; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingPoly, options); + return object; + }; + + /** + * Converts this ProductSearchParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ProductSearchParams + * @instance + * @returns {Object.} JSON object + */ + ProductSearchParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSearchParams; + })(); + + v1.ProductSearchResults = (function() { + + /** + * Properties of a ProductSearchResults. + * @memberof google.cloud.vision.v1 + * @interface IProductSearchResults + * @property {google.protobuf.ITimestamp|null} [indexTime] ProductSearchResults indexTime + * @property {Array.|null} [results] ProductSearchResults results + * @property {Array.|null} [productGroupedResults] ProductSearchResults productGroupedResults + */ + + /** + * Constructs a new ProductSearchResults. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ProductSearchResults. + * @implements IProductSearchResults + * @constructor + * @param {google.cloud.vision.v1.IProductSearchResults=} [properties] Properties to set + */ + function ProductSearchResults(properties) { + this.results = []; + this.productGroupedResults = []; + 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]]; + } + + /** + * ProductSearchResults indexTime. + * @member {google.protobuf.ITimestamp|null|undefined} indexTime + * @memberof google.cloud.vision.v1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.indexTime = null; + + /** + * ProductSearchResults results. + * @member {Array.} results + * @memberof google.cloud.vision.v1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.results = $util.emptyArray; + + /** + * ProductSearchResults productGroupedResults. + * @member {Array.} productGroupedResults + * @memberof google.cloud.vision.v1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.productGroupedResults = $util.emptyArray; + + /** + * Creates a new ProductSearchResults instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1.IProductSearchResults=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ProductSearchResults} ProductSearchResults instance + */ + ProductSearchResults.create = function create(properties) { + return new ProductSearchResults(properties); + }; + + /** + * Encodes the specified ProductSearchResults message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1.IProductSearchResults} message ProductSearchResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexTime != null && message.hasOwnProperty("indexTime")) + $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.vision.v1.ProductSearchResults.Result.encode(message.results[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.productGroupedResults != null && message.productGroupedResults.length) + for (var i = 0; i < message.productGroupedResults.length; ++i) + $root.google.cloud.vision.v1.ProductSearchResults.GroupedResult.encode(message.productGroupedResults[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSearchResults message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1.IProductSearchResults} message ProductSearchResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ProductSearchResults} ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchResults.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.vision.v1.ProductSearchResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.vision.v1.ProductSearchResults.Result.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.productGroupedResults && message.productGroupedResults.length)) + message.productGroupedResults = []; + message.productGroupedResults.push($root.google.cloud.vision.v1.ProductSearchResults.GroupedResult.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ProductSearchResults} ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSearchResults message. + * @function verify + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSearchResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexTime != null && message.hasOwnProperty("indexTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (error) + return "indexTime." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.vision.v1.ProductSearchResults.Result.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.productGroupedResults != null && message.hasOwnProperty("productGroupedResults")) { + if (!Array.isArray(message.productGroupedResults)) + return "productGroupedResults: array expected"; + for (var i = 0; i < message.productGroupedResults.length; ++i) { + var error = $root.google.cloud.vision.v1.ProductSearchResults.GroupedResult.verify(message.productGroupedResults[i]); + if (error) + return "productGroupedResults." + error; + } + } + return null; + }; + + /** + * Creates a ProductSearchResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ProductSearchResults} ProductSearchResults + */ + ProductSearchResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ProductSearchResults) + return object; + var message = new $root.google.cloud.vision.v1.ProductSearchResults(); + if (object.indexTime != null) { + if (typeof object.indexTime !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.indexTime: object expected"); + message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.results: object expected"); + message.results[i] = $root.google.cloud.vision.v1.ProductSearchResults.Result.fromObject(object.results[i]); + } + } + if (object.productGroupedResults) { + if (!Array.isArray(object.productGroupedResults)) + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.productGroupedResults: array expected"); + message.productGroupedResults = []; + for (var i = 0; i < object.productGroupedResults.length; ++i) { + if (typeof object.productGroupedResults[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.productGroupedResults: object expected"); + message.productGroupedResults[i] = $root.google.cloud.vision.v1.ProductSearchResults.GroupedResult.fromObject(object.productGroupedResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProductSearchResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1.ProductSearchResults} message ProductSearchResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSearchResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.productGroupedResults = []; + } + if (options.defaults) + object.indexTime = null; + if (message.indexTime != null && message.hasOwnProperty("indexTime")) + object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.vision.v1.ProductSearchResults.Result.toObject(message.results[j], options); + } + if (message.productGroupedResults && message.productGroupedResults.length) { + object.productGroupedResults = []; + for (var j = 0; j < message.productGroupedResults.length; ++j) + object.productGroupedResults[j] = $root.google.cloud.vision.v1.ProductSearchResults.GroupedResult.toObject(message.productGroupedResults[j], options); + } + return object; + }; + + /** + * Converts this ProductSearchResults to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ProductSearchResults + * @instance + * @returns {Object.} JSON object + */ + ProductSearchResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ProductSearchResults.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.cloud.vision.v1.ProductSearchResults + * @interface IResult + * @property {google.cloud.vision.v1.IProduct|null} [product] Result product + * @property {number|null} [score] Result score + * @property {string|null} [image] Result image + */ + + /** + * Constructs a new Result. + * @memberof google.cloud.vision.v1.ProductSearchResults + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.cloud.vision.v1.ProductSearchResults.IResult=} [properties] Properties to set + */ + function Result(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]]; + } + + /** + * Result product. + * @member {google.cloud.vision.v1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @instance + */ + Result.prototype.product = null; + + /** + * Result score. + * @member {number} score + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @instance + */ + Result.prototype.score = 0; + + /** + * Result image. + * @member {string} image + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @instance + */ + Result.prototype.image = ""; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IResult=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ProductSearchResults.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.Result.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1.Product.encode(message.product, 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); + if (message.image != null && message.hasOwnProperty("image")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.image); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ProductSearchResults.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.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.vision.v1.ProductSearchResults.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.vision.v1.Product.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.image = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ProductSearchResults.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ProductSearchResults.Result} Result + */ + Result.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ProductSearchResults.Result) + return object; + var message = new $root.google.cloud.vision.v1.ProductSearchResults.Result(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.Result.product: object expected"); + message.product = $root.google.cloud.vision.v1.Product.fromObject(object.product); + } + if (object.score != null) + message.score = Number(object.score); + if (object.image != null) + message.image = String(object.image); + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.score = 0; + object.image = ""; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1.Product.toObject(message.product, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ProductSearchResults.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Result; + })(); + + ProductSearchResults.ObjectAnnotation = (function() { + + /** + * Properties of an ObjectAnnotation. + * @memberof google.cloud.vision.v1.ProductSearchResults + * @interface IObjectAnnotation + * @property {string|null} [mid] ObjectAnnotation mid + * @property {string|null} [languageCode] ObjectAnnotation languageCode + * @property {string|null} [name] ObjectAnnotation name + * @property {number|null} [score] ObjectAnnotation score + */ + + /** + * Constructs a new ObjectAnnotation. + * @memberof google.cloud.vision.v1.ProductSearchResults + * @classdesc Represents an ObjectAnnotation. + * @implements IObjectAnnotation + * @constructor + * @param {google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation=} [properties] Properties to set + */ + function ObjectAnnotation(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]]; + } + + /** + * ObjectAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @instance + */ + ObjectAnnotation.prototype.mid = ""; + + /** + * ObjectAnnotation languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @instance + */ + ObjectAnnotation.prototype.languageCode = ""; + + /** + * ObjectAnnotation name. + * @member {string} name + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @instance + */ + ObjectAnnotation.prototype.name = ""; + + /** + * ObjectAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @instance + */ + ObjectAnnotation.prototype.score = 0; + + /** + * Creates a new ObjectAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation} ObjectAnnotation instance + */ + ObjectAnnotation.create = function create(properties) { + return new ObjectAnnotation(properties); + }; + + /** + * Encodes the specified ObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation} message ObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + return writer; + }; + + /** + * Encodes the specified ObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IObjectAnnotation} message ObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation} ObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectAnnotation.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.vision.v1.ProductSearchResults.ObjectAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation} ObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates an ObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation} ObjectAnnotation + */ + ObjectAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.name != null) + message.name = String(object.name); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from an ObjectAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation} message ObjectAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mid = ""; + object.languageCode = ""; + object.name = ""; + object.score = 0; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ObjectAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation + * @instance + * @returns {Object.} JSON object + */ + ObjectAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ObjectAnnotation; + })(); + + ProductSearchResults.GroupedResult = (function() { + + /** + * Properties of a GroupedResult. + * @memberof google.cloud.vision.v1.ProductSearchResults + * @interface IGroupedResult + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingPoly] GroupedResult boundingPoly + * @property {Array.|null} [results] GroupedResult results + * @property {Array.|null} [objectAnnotations] GroupedResult objectAnnotations + */ + + /** + * Constructs a new GroupedResult. + * @memberof google.cloud.vision.v1.ProductSearchResults + * @classdesc Represents a GroupedResult. + * @implements IGroupedResult + * @constructor + * @param {google.cloud.vision.v1.ProductSearchResults.IGroupedResult=} [properties] Properties to set + */ + function GroupedResult(properties) { + this.results = []; + this.objectAnnotations = []; + 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]]; + } + + /** + * GroupedResult boundingPoly. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @instance + */ + GroupedResult.prototype.boundingPoly = null; + + /** + * GroupedResult results. + * @member {Array.} results + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @instance + */ + GroupedResult.prototype.results = $util.emptyArray; + + /** + * GroupedResult objectAnnotations. + * @member {Array.} objectAnnotations + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @instance + */ + GroupedResult.prototype.objectAnnotations = $util.emptyArray; + + /** + * Creates a new GroupedResult instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IGroupedResult=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ProductSearchResults.GroupedResult} GroupedResult instance + */ + GroupedResult.create = function create(properties) { + return new GroupedResult(properties); + }; + + /** + * Encodes the specified GroupedResult message. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IGroupedResult} message GroupedResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupedResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.vision.v1.ProductSearchResults.Result.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.objectAnnotations != null && message.objectAnnotations.length) + for (var i = 0; i < message.objectAnnotations.length; ++i) + $root.google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.encode(message.objectAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupedResult message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.IGroupedResult} message GroupedResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupedResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupedResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ProductSearchResults.GroupedResult} GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupedResult.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.vision.v1.ProductSearchResults.GroupedResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.vision.v1.ProductSearchResults.Result.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.objectAnnotations && message.objectAnnotations.length)) + message.objectAnnotations = []; + message.objectAnnotations.push($root.google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupedResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ProductSearchResults.GroupedResult} GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupedResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupedResult message. + * @function verify + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupedResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.vision.v1.ProductSearchResults.Result.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.objectAnnotations != null && message.hasOwnProperty("objectAnnotations")) { + if (!Array.isArray(message.objectAnnotations)) + return "objectAnnotations: array expected"; + for (var i = 0; i < message.objectAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.verify(message.objectAnnotations[i]); + if (error) + return "objectAnnotations." + error; + } + } + return null; + }; + + /** + * Creates a GroupedResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ProductSearchResults.GroupedResult} GroupedResult + */ + GroupedResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ProductSearchResults.GroupedResult) + return object; + var message = new $root.google.cloud.vision.v1.ProductSearchResults.GroupedResult(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.GroupedResult.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.GroupedResult.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.GroupedResult.results: object expected"); + message.results[i] = $root.google.cloud.vision.v1.ProductSearchResults.Result.fromObject(object.results[i]); + } + } + if (object.objectAnnotations) { + if (!Array.isArray(object.objectAnnotations)) + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.GroupedResult.objectAnnotations: array expected"); + message.objectAnnotations = []; + for (var i = 0; i < object.objectAnnotations.length; ++i) { + if (typeof object.objectAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSearchResults.GroupedResult.objectAnnotations: object expected"); + message.objectAnnotations[i] = $root.google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.fromObject(object.objectAnnotations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupedResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1.ProductSearchResults.GroupedResult} message GroupedResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupedResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.objectAnnotations = []; + } + if (options.defaults) + object.boundingPoly = null; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.vision.v1.ProductSearchResults.Result.toObject(message.results[j], options); + } + if (message.objectAnnotations && message.objectAnnotations.length) { + object.objectAnnotations = []; + for (var j = 0; j < message.objectAnnotations.length; ++j) + object.objectAnnotations[j] = $root.google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation.toObject(message.objectAnnotations[j], options); + } + return object; + }; + + /** + * Converts this GroupedResult to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ProductSearchResults.GroupedResult + * @instance + * @returns {Object.} JSON object + */ + GroupedResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupedResult; + })(); + + return ProductSearchResults; + })(); + + v1.ProductSearch = (function() { + + /** + * Constructs a new ProductSearch service. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ProductSearch + * @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 ProductSearch(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ProductSearch.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductSearch; + + /** + * Creates new ProductSearch service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1.ProductSearch + * @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 {ProductSearch} RPC service. Useful where requests and/or responses are streamed. + */ + ProductSearch.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#createProductSet}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef CreateProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ProductSet} [response] ProductSet + */ + + /** + * Calls CreateProductSet. + * @function createProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.ICreateProductSetRequest} request CreateProductSetRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.CreateProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createProductSet = function createProductSet(request, callback) { + return this.rpcCall(createProductSet, $root.google.cloud.vision.v1.CreateProductSetRequest, $root.google.cloud.vision.v1.ProductSet, request, callback); + }, "name", { value: "CreateProductSet" }); + + /** + * Calls CreateProductSet. + * @function createProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.ICreateProductSetRequest} request CreateProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listProductSets}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef ListProductSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ListProductSetsResponse} [response] ListProductSetsResponse + */ + + /** + * Calls ListProductSets. + * @function listProductSets + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListProductSetsRequest} request ListProductSetsRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.ListProductSetsCallback} callback Node-style callback called with the error, if any, and ListProductSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProductSets = function listProductSets(request, callback) { + return this.rpcCall(listProductSets, $root.google.cloud.vision.v1.ListProductSetsRequest, $root.google.cloud.vision.v1.ListProductSetsResponse, request, callback); + }, "name", { value: "ListProductSets" }); + + /** + * Calls ListProductSets. + * @function listProductSets + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListProductSetsRequest} request ListProductSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#getProductSet}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef GetProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ProductSet} [response] ProductSet + */ + + /** + * Calls GetProductSet. + * @function getProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IGetProductSetRequest} request GetProductSetRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.GetProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getProductSet = function getProductSet(request, callback) { + return this.rpcCall(getProductSet, $root.google.cloud.vision.v1.GetProductSetRequest, $root.google.cloud.vision.v1.ProductSet, request, callback); + }, "name", { value: "GetProductSet" }); + + /** + * Calls GetProductSet. + * @function getProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IGetProductSetRequest} request GetProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#updateProductSet}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef UpdateProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ProductSet} [response] ProductSet + */ + + /** + * Calls UpdateProductSet. + * @function updateProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IUpdateProductSetRequest} request UpdateProductSetRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.UpdateProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.updateProductSet = function updateProductSet(request, callback) { + return this.rpcCall(updateProductSet, $root.google.cloud.vision.v1.UpdateProductSetRequest, $root.google.cloud.vision.v1.ProductSet, request, callback); + }, "name", { value: "UpdateProductSet" }); + + /** + * Calls UpdateProductSet. + * @function updateProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IUpdateProductSetRequest} request UpdateProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#deleteProductSet}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef DeleteProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteProductSet. + * @function deleteProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IDeleteProductSetRequest} request DeleteProductSetRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.DeleteProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteProductSet = function deleteProductSet(request, callback) { + return this.rpcCall(deleteProductSet, $root.google.cloud.vision.v1.DeleteProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProductSet" }); + + /** + * Calls DeleteProductSet. + * @function deleteProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IDeleteProductSetRequest} request DeleteProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#createProduct}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef CreateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.Product} [response] Product + */ + + /** + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.ICreateProductRequest} request CreateProductRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.CreateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createProduct = function createProduct(request, callback) { + return this.rpcCall(createProduct, $root.google.cloud.vision.v1.CreateProductRequest, $root.google.cloud.vision.v1.Product, request, callback); + }, "name", { value: "CreateProduct" }); + + /** + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.ICreateProductRequest} request CreateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listProducts}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef ListProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ListProductsResponse} [response] ListProductsResponse + */ + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListProductsRequest} request ListProductsRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProducts = function listProducts(request, callback) { + return this.rpcCall(listProducts, $root.google.cloud.vision.v1.ListProductsRequest, $root.google.cloud.vision.v1.ListProductsResponse, request, callback); + }, "name", { value: "ListProducts" }); + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListProductsRequest} request ListProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#getProduct}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef GetProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.Product} [response] Product + */ + + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IGetProductRequest} request GetProductRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.GetProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getProduct = function getProduct(request, callback) { + return this.rpcCall(getProduct, $root.google.cloud.vision.v1.GetProductRequest, $root.google.cloud.vision.v1.Product, request, callback); + }, "name", { value: "GetProduct" }); + + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IGetProductRequest} request GetProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#updateProduct}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef UpdateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.Product} [response] Product + */ + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.updateProduct = function updateProduct(request, callback) { + return this.rpcCall(updateProduct, $root.google.cloud.vision.v1.UpdateProductRequest, $root.google.cloud.vision.v1.Product, request, callback); + }, "name", { value: "UpdateProduct" }); + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#deleteProduct}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef DeleteProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteProduct = function deleteProduct(request, callback) { + return this.rpcCall(deleteProduct, $root.google.cloud.vision.v1.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProduct" }); + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#createReferenceImage}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef CreateReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ReferenceImage} [response] ReferenceImage + */ + + /** + * Calls CreateReferenceImage. + * @function createReferenceImage + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.ICreateReferenceImageRequest} request CreateReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.CreateReferenceImageCallback} callback Node-style callback called with the error, if any, and ReferenceImage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createReferenceImage = function createReferenceImage(request, callback) { + return this.rpcCall(createReferenceImage, $root.google.cloud.vision.v1.CreateReferenceImageRequest, $root.google.cloud.vision.v1.ReferenceImage, request, callback); + }, "name", { value: "CreateReferenceImage" }); + + /** + * Calls CreateReferenceImage. + * @function createReferenceImage + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.ICreateReferenceImageRequest} request CreateReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#deleteReferenceImage}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef DeleteReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteReferenceImage. + * @function deleteReferenceImage + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IDeleteReferenceImageRequest} request DeleteReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.DeleteReferenceImageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteReferenceImage = function deleteReferenceImage(request, callback) { + return this.rpcCall(deleteReferenceImage, $root.google.cloud.vision.v1.DeleteReferenceImageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteReferenceImage" }); + + /** + * Calls DeleteReferenceImage. + * @function deleteReferenceImage + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IDeleteReferenceImageRequest} request DeleteReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listReferenceImages}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef ListReferenceImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ListReferenceImagesResponse} [response] ListReferenceImagesResponse + */ + + /** + * Calls ListReferenceImages. + * @function listReferenceImages + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListReferenceImagesRequest} request ListReferenceImagesRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.ListReferenceImagesCallback} callback Node-style callback called with the error, if any, and ListReferenceImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listReferenceImages = function listReferenceImages(request, callback) { + return this.rpcCall(listReferenceImages, $root.google.cloud.vision.v1.ListReferenceImagesRequest, $root.google.cloud.vision.v1.ListReferenceImagesResponse, request, callback); + }, "name", { value: "ListReferenceImages" }); + + /** + * Calls ListReferenceImages. + * @function listReferenceImages + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListReferenceImagesRequest} request ListReferenceImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#getReferenceImage}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef GetReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ReferenceImage} [response] ReferenceImage + */ + + /** + * Calls GetReferenceImage. + * @function getReferenceImage + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IGetReferenceImageRequest} request GetReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.GetReferenceImageCallback} callback Node-style callback called with the error, if any, and ReferenceImage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getReferenceImage = function getReferenceImage(request, callback) { + return this.rpcCall(getReferenceImage, $root.google.cloud.vision.v1.GetReferenceImageRequest, $root.google.cloud.vision.v1.ReferenceImage, request, callback); + }, "name", { value: "GetReferenceImage" }); + + /** + * Calls GetReferenceImage. + * @function getReferenceImage + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IGetReferenceImageRequest} request GetReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#addProductToProductSet}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef AddProductToProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls AddProductToProductSet. + * @function addProductToProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IAddProductToProductSetRequest} request AddProductToProductSetRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.AddProductToProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.addProductToProductSet = function addProductToProductSet(request, callback) { + return this.rpcCall(addProductToProductSet, $root.google.cloud.vision.v1.AddProductToProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "AddProductToProductSet" }); + + /** + * Calls AddProductToProductSet. + * @function addProductToProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IAddProductToProductSetRequest} request AddProductToProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#removeProductFromProductSet}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef RemoveProductFromProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls RemoveProductFromProductSet. + * @function removeProductFromProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IRemoveProductFromProductSetRequest} request RemoveProductFromProductSetRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.RemoveProductFromProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.removeProductFromProductSet = function removeProductFromProductSet(request, callback) { + return this.rpcCall(removeProductFromProductSet, $root.google.cloud.vision.v1.RemoveProductFromProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "RemoveProductFromProductSet" }); + + /** + * Calls RemoveProductFromProductSet. + * @function removeProductFromProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IRemoveProductFromProductSetRequest} request RemoveProductFromProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#listProductsInProductSet}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef ListProductsInProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1.ListProductsInProductSetResponse} [response] ListProductsInProductSetResponse + */ + + /** + * Calls ListProductsInProductSet. + * @function listProductsInProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListProductsInProductSetRequest} request ListProductsInProductSetRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.ListProductsInProductSetCallback} callback Node-style callback called with the error, if any, and ListProductsInProductSetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProductsInProductSet = function listProductsInProductSet(request, callback) { + return this.rpcCall(listProductsInProductSet, $root.google.cloud.vision.v1.ListProductsInProductSetRequest, $root.google.cloud.vision.v1.ListProductsInProductSetResponse, request, callback); + }, "name", { value: "ListProductsInProductSet" }); + + /** + * Calls ListProductsInProductSet. + * @function listProductsInProductSet + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IListProductsInProductSetRequest} request ListProductsInProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#importProductSets}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef ImportProductSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportProductSets. + * @function importProductSets + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IImportProductSetsRequest} request ImportProductSetsRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.ImportProductSetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.importProductSets = function importProductSets(request, callback) { + return this.rpcCall(importProductSets, $root.google.cloud.vision.v1.ImportProductSetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportProductSets" }); + + /** + * Calls ImportProductSets. + * @function importProductSets + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IImportProductSetsRequest} request ImportProductSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1.ProductSearch#purgeProducts}. + * @memberof google.cloud.vision.v1.ProductSearch + * @typedef PurgeProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @param {google.cloud.vision.v1.ProductSearch.PurgeProductsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.purgeProducts = function purgeProducts(request, callback) { + return this.rpcCall(purgeProducts, $root.google.cloud.vision.v1.PurgeProductsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeProducts" }); + + /** + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.vision.v1.ProductSearch + * @instance + * @param {google.cloud.vision.v1.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProductSearch; + })(); + + v1.Product = (function() { + + /** + * Properties of a Product. + * @memberof google.cloud.vision.v1 + * @interface IProduct + * @property {string|null} [name] Product name + * @property {string|null} [displayName] Product displayName + * @property {string|null} [description] Product description + * @property {string|null} [productCategory] Product productCategory + * @property {Array.|null} [productLabels] Product productLabels + */ + + /** + * Constructs a new Product. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Product. + * @implements IProduct + * @constructor + * @param {google.cloud.vision.v1.IProduct=} [properties] Properties to set + */ + function Product(properties) { + this.productLabels = []; + 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]]; + } + + /** + * Product name. + * @member {string} name + * @memberof google.cloud.vision.v1.Product + * @instance + */ + Product.prototype.name = ""; + + /** + * Product displayName. + * @member {string} displayName + * @memberof google.cloud.vision.v1.Product + * @instance + */ + Product.prototype.displayName = ""; + + /** + * Product description. + * @member {string} description + * @memberof google.cloud.vision.v1.Product + * @instance + */ + Product.prototype.description = ""; + + /** + * Product productCategory. + * @member {string} productCategory + * @memberof google.cloud.vision.v1.Product + * @instance + */ + Product.prototype.productCategory = ""; + + /** + * Product productLabels. + * @member {Array.} productLabels + * @memberof google.cloud.vision.v1.Product + * @instance + */ + Product.prototype.productLabels = $util.emptyArray; + + /** + * Creates a new Product instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Product + * @static + * @param {google.cloud.vision.v1.IProduct=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Product} Product instance + */ + Product.create = function create(properties) { + return new Product(properties); + }; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.vision.v1.Product.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Product + * @static + * @param {google.cloud.vision.v1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.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.productCategory != null && message.hasOwnProperty("productCategory")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.productCategory); + if (message.productLabels != null && message.productLabels.length) + for (var i = 0; i < message.productLabels.length; ++i) + $root.google.cloud.vision.v1.Product.KeyValue.encode(message.productLabels[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Product.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Product + * @static + * @param {google.cloud.vision.v1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Product message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.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.vision.v1.Product(); + 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 3: + message.description = reader.string(); + break; + case 4: + message.productCategory = reader.string(); + break; + case 5: + if (!(message.productLabels && message.productLabels.length)) + message.productLabels = []; + message.productLabels.push($root.google.cloud.vision.v1.Product.KeyValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Product message. + * @function verify + * @memberof google.cloud.vision.v1.Product + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Product.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + if (!$util.isString(message.productCategory)) + return "productCategory: string expected"; + if (message.productLabels != null && message.hasOwnProperty("productLabels")) { + if (!Array.isArray(message.productLabels)) + return "productLabels: array expected"; + for (var i = 0; i < message.productLabels.length; ++i) { + var error = $root.google.cloud.vision.v1.Product.KeyValue.verify(message.productLabels[i]); + if (error) + return "productLabels." + error; + } + } + return null; + }; + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Product + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Product} Product + */ + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Product) + return object; + var message = new $root.google.cloud.vision.v1.Product(); + 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.productCategory != null) + message.productCategory = String(object.productCategory); + if (object.productLabels) { + if (!Array.isArray(object.productLabels)) + throw TypeError(".google.cloud.vision.v1.Product.productLabels: array expected"); + message.productLabels = []; + for (var i = 0; i < object.productLabels.length; ++i) { + if (typeof object.productLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1.Product.productLabels: object expected"); + message.productLabels[i] = $root.google.cloud.vision.v1.Product.KeyValue.fromObject(object.productLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Product + * @static + * @param {google.cloud.vision.v1.Product} message Product + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Product.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productLabels = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.productCategory = ""; + } + 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.productCategory != null && message.hasOwnProperty("productCategory")) + object.productCategory = message.productCategory; + if (message.productLabels && message.productLabels.length) { + object.productLabels = []; + for (var j = 0; j < message.productLabels.length; ++j) + object.productLabels[j] = $root.google.cloud.vision.v1.Product.KeyValue.toObject(message.productLabels[j], options); + } + return object; + }; + + /** + * Converts this Product to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Product + * @instance + * @returns {Object.} JSON object + */ + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Product.KeyValue = (function() { + + /** + * Properties of a KeyValue. + * @memberof google.cloud.vision.v1.Product + * @interface IKeyValue + * @property {string|null} [key] KeyValue key + * @property {string|null} [value] KeyValue value + */ + + /** + * Constructs a new KeyValue. + * @memberof google.cloud.vision.v1.Product + * @classdesc Represents a KeyValue. + * @implements IKeyValue + * @constructor + * @param {google.cloud.vision.v1.Product.IKeyValue=} [properties] Properties to set + */ + function KeyValue(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]]; + } + + /** + * KeyValue key. + * @member {string} key + * @memberof google.cloud.vision.v1.Product.KeyValue + * @instance + */ + KeyValue.prototype.key = ""; + + /** + * KeyValue value. + * @member {string} value + * @memberof google.cloud.vision.v1.Product.KeyValue + * @instance + */ + KeyValue.prototype.value = ""; + + /** + * Creates a new KeyValue instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1.Product.IKeyValue=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Product.KeyValue} KeyValue instance + */ + KeyValue.create = function create(properties) { + return new KeyValue(properties); + }; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.cloud.vision.v1.Product.KeyValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1.Product.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && message.hasOwnProperty("key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Product.KeyValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1.Product.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Product.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.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.vision.v1.Product.KeyValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Product.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyValue message. + * @function verify + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Product.KeyValue} KeyValue + */ + KeyValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Product.KeyValue) + return object; + var message = new $root.google.cloud.vision.v1.Product.KeyValue(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1.Product.KeyValue} message KeyValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this KeyValue to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Product.KeyValue + * @instance + * @returns {Object.} JSON object + */ + KeyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KeyValue; + })(); + + return Product; + })(); + + v1.ProductSet = (function() { + + /** + * Properties of a ProductSet. + * @memberof google.cloud.vision.v1 + * @interface IProductSet + * @property {string|null} [name] ProductSet name + * @property {string|null} [displayName] ProductSet displayName + * @property {google.protobuf.ITimestamp|null} [indexTime] ProductSet indexTime + * @property {google.rpc.IStatus|null} [indexError] ProductSet indexError + */ + + /** + * Constructs a new ProductSet. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ProductSet. + * @implements IProductSet + * @constructor + * @param {google.cloud.vision.v1.IProductSet=} [properties] Properties to set + */ + function ProductSet(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]]; + } + + /** + * ProductSet name. + * @member {string} name + * @memberof google.cloud.vision.v1.ProductSet + * @instance + */ + ProductSet.prototype.name = ""; + + /** + * ProductSet displayName. + * @member {string} displayName + * @memberof google.cloud.vision.v1.ProductSet + * @instance + */ + ProductSet.prototype.displayName = ""; + + /** + * ProductSet indexTime. + * @member {google.protobuf.ITimestamp|null|undefined} indexTime + * @memberof google.cloud.vision.v1.ProductSet + * @instance + */ + ProductSet.prototype.indexTime = null; + + /** + * ProductSet indexError. + * @member {google.rpc.IStatus|null|undefined} indexError + * @memberof google.cloud.vision.v1.ProductSet + * @instance + */ + ProductSet.prototype.indexError = null; + + /** + * Creates a new ProductSet instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {google.cloud.vision.v1.IProductSet=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ProductSet} ProductSet instance + */ + ProductSet.create = function create(properties) { + return new ProductSet(properties); + }; + + /** + * Encodes the specified ProductSet message. Does not implicitly {@link google.cloud.vision.v1.ProductSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {google.cloud.vision.v1.IProductSet} message ProductSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSet.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.indexTime != null && message.hasOwnProperty("indexTime")) + $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.indexError != null && message.hasOwnProperty("indexError")) + $root.google.rpc.Status.encode(message.indexError, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSet message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {google.cloud.vision.v1.IProductSet} message ProductSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ProductSet} ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSet.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.vision.v1.ProductSet(); + 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 3: + message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.indexError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ProductSet} ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSet message. + * @function verify + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSet.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.indexTime != null && message.hasOwnProperty("indexTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (error) + return "indexTime." + error; + } + if (message.indexError != null && message.hasOwnProperty("indexError")) { + var error = $root.google.rpc.Status.verify(message.indexError); + if (error) + return "indexError." + error; + } + return null; + }; + + /** + * Creates a ProductSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ProductSet} ProductSet + */ + ProductSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ProductSet) + return object; + var message = new $root.google.cloud.vision.v1.ProductSet(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.indexTime != null) { + if (typeof object.indexTime !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSet.indexTime: object expected"); + message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + } + if (object.indexError != null) { + if (typeof object.indexError !== "object") + throw TypeError(".google.cloud.vision.v1.ProductSet.indexError: object expected"); + message.indexError = $root.google.rpc.Status.fromObject(object.indexError); + } + return message; + }; + + /** + * Creates a plain object from a ProductSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ProductSet + * @static + * @param {google.cloud.vision.v1.ProductSet} message ProductSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.indexTime = null; + object.indexError = 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.indexTime != null && message.hasOwnProperty("indexTime")) + object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + if (message.indexError != null && message.hasOwnProperty("indexError")) + object.indexError = $root.google.rpc.Status.toObject(message.indexError, options); + return object; + }; + + /** + * Converts this ProductSet to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ProductSet + * @instance + * @returns {Object.} JSON object + */ + ProductSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSet; + })(); + + v1.ReferenceImage = (function() { + + /** + * Properties of a ReferenceImage. + * @memberof google.cloud.vision.v1 + * @interface IReferenceImage + * @property {string|null} [name] ReferenceImage name + * @property {string|null} [uri] ReferenceImage uri + * @property {Array.|null} [boundingPolys] ReferenceImage boundingPolys + */ + + /** + * Constructs a new ReferenceImage. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ReferenceImage. + * @implements IReferenceImage + * @constructor + * @param {google.cloud.vision.v1.IReferenceImage=} [properties] Properties to set + */ + function ReferenceImage(properties) { + this.boundingPolys = []; + 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]]; + } + + /** + * ReferenceImage name. + * @member {string} name + * @memberof google.cloud.vision.v1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.name = ""; + + /** + * ReferenceImage uri. + * @member {string} uri + * @memberof google.cloud.vision.v1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.uri = ""; + + /** + * ReferenceImage boundingPolys. + * @member {Array.} boundingPolys + * @memberof google.cloud.vision.v1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.boundingPolys = $util.emptyArray; + + /** + * Creates a new ReferenceImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {google.cloud.vision.v1.IReferenceImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ReferenceImage} ReferenceImage instance + */ + ReferenceImage.create = function create(properties) { + return new ReferenceImage(properties); + }; + + /** + * Encodes the specified ReferenceImage message. Does not implicitly {@link google.cloud.vision.v1.ReferenceImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {google.cloud.vision.v1.IReferenceImage} message ReferenceImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferenceImage.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.boundingPolys != null && message.boundingPolys.length) + for (var i = 0; i < message.boundingPolys.length; ++i) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingPolys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReferenceImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ReferenceImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {google.cloud.vision.v1.IReferenceImage} message ReferenceImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferenceImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ReferenceImage} ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferenceImage.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.vision.v1.ReferenceImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + case 3: + if (!(message.boundingPolys && message.boundingPolys.length)) + message.boundingPolys = []; + message.boundingPolys.push($root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ReferenceImage} ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferenceImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReferenceImage message. + * @function verify + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReferenceImage.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.boundingPolys != null && message.hasOwnProperty("boundingPolys")) { + if (!Array.isArray(message.boundingPolys)) + return "boundingPolys: array expected"; + for (var i = 0; i < message.boundingPolys.length; ++i) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingPolys[i]); + if (error) + return "boundingPolys." + error; + } + } + return null; + }; + + /** + * Creates a ReferenceImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ReferenceImage} ReferenceImage + */ + ReferenceImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ReferenceImage) + return object; + var message = new $root.google.cloud.vision.v1.ReferenceImage(); + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.boundingPolys) { + if (!Array.isArray(object.boundingPolys)) + throw TypeError(".google.cloud.vision.v1.ReferenceImage.boundingPolys: array expected"); + message.boundingPolys = []; + for (var i = 0; i < object.boundingPolys.length; ++i) { + if (typeof object.boundingPolys[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ReferenceImage.boundingPolys: object expected"); + message.boundingPolys[i] = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingPolys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReferenceImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ReferenceImage + * @static + * @param {google.cloud.vision.v1.ReferenceImage} message ReferenceImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReferenceImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingPolys = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.boundingPolys && message.boundingPolys.length) { + object.boundingPolys = []; + for (var j = 0; j < message.boundingPolys.length; ++j) + object.boundingPolys[j] = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingPolys[j], options); + } + return object; + }; + + /** + * Converts this ReferenceImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ReferenceImage + * @instance + * @returns {Object.} JSON object + */ + ReferenceImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReferenceImage; + })(); + + v1.CreateProductRequest = (function() { + + /** + * Properties of a CreateProductRequest. + * @memberof google.cloud.vision.v1 + * @interface ICreateProductRequest + * @property {string|null} [parent] CreateProductRequest parent + * @property {google.cloud.vision.v1.IProduct|null} [product] CreateProductRequest product + * @property {string|null} [productId] CreateProductRequest productId + */ + + /** + * Constructs a new CreateProductRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a CreateProductRequest. + * @implements ICreateProductRequest + * @constructor + * @param {google.cloud.vision.v1.ICreateProductRequest=} [properties] Properties to set + */ + function CreateProductRequest(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]]; + } + + /** + * CreateProductRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.parent = ""; + + /** + * CreateProductRequest product. + * @member {google.cloud.vision.v1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.product = null; + + /** + * CreateProductRequest productId. + * @member {string} productId + * @memberof google.cloud.vision.v1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.productId = ""; + + /** + * Creates a new CreateProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1.ICreateProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.CreateProductRequest} CreateProductRequest instance + */ + CreateProductRequest.create = function create(properties) { + return new CreateProductRequest(properties); + }; + + /** + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.vision.v1.CreateProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductRequest.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.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productId != null && message.hasOwnProperty("productId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); + return writer; + }; + + /** + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CreateProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.CreateProductRequest} CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductRequest.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.vision.v1.CreateProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.product = $root.google.cloud.vision.v1.Product.decode(reader, reader.uint32()); + break; + case 3: + message.productId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.CreateProductRequest} CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProductRequest.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.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + return null; + }; + + /** + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.CreateProductRequest} CreateProductRequest + */ + CreateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.CreateProductRequest) + return object; + var message = new $root.google.cloud.vision.v1.CreateProductRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1.CreateProductRequest.product: object expected"); + message.product = $root.google.cloud.vision.v1.Product.fromObject(object.product); + } + if (object.productId != null) + message.productId = String(object.productId); + return message; + }; + + /** + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1.CreateProductRequest} message CreateProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.product = null; + object.productId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1.Product.toObject(message.product, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + return object; + }; + + /** + * Converts this CreateProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.CreateProductRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateProductRequest; + })(); + + v1.ListProductsRequest = (function() { + + /** + * Properties of a ListProductsRequest. + * @memberof google.cloud.vision.v1 + * @interface IListProductsRequest + * @property {string|null} [parent] ListProductsRequest parent + * @property {number|null} [pageSize] ListProductsRequest pageSize + * @property {string|null} [pageToken] ListProductsRequest pageToken + */ + + /** + * Constructs a new ListProductsRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListProductsRequest. + * @implements IListProductsRequest + * @constructor + * @param {google.cloud.vision.v1.IListProductsRequest=} [properties] Properties to set + */ + function ListProductsRequest(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]]; + } + + /** + * ListProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.parent = ""; + + /** + * ListProductsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageSize = 0; + + /** + * ListProductsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1.IListProductsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListProductsRequest} ListProductsRequest instance + */ + ListProductsRequest.create = function create(properties) { + return new ListProductsRequest(properties); + }; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.vision.v1.ListProductsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.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.vision.v1.ListProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsRequest message. + * @function verify + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsRequest.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.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 ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListProductsRequest} ListProductsRequest + */ + ListProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListProductsRequest) + return object; + var message = new $root.google.cloud.vision.v1.ListProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1.ListProductsRequest} message ListProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListProductsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsRequest; + })(); + + v1.ListProductsResponse = (function() { + + /** + * Properties of a ListProductsResponse. + * @memberof google.cloud.vision.v1 + * @interface IListProductsResponse + * @property {Array.|null} [products] ListProductsResponse products + * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken + */ + + /** + * Constructs a new ListProductsResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListProductsResponse. + * @implements IListProductsResponse + * @constructor + * @param {google.cloud.vision.v1.IListProductsResponse=} [properties] Properties to set + */ + function ListProductsResponse(properties) { + this.products = []; + 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]]; + } + + /** + * ListProductsResponse products. + * @member {Array.} products + * @memberof google.cloud.vision.v1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.products = $util.emptyArray; + + /** + * ListProductsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1.IListProductsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListProductsResponse} ListProductsResponse instance + */ + ListProductsResponse.create = function create(properties) { + return new ListProductsResponse(properties); + }; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.vision.v1.ListProductsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.vision.v1.Product.encode(message.products[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 ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.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.vision.v1.ListProductsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.vision.v1.Product.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsResponse message. + * @function verify + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.vision.v1.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListProductsResponse} ListProductsResponse + */ + ListProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListProductsResponse) + return object; + var message = new $root.google.cloud.vision.v1.ListProductsResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.vision.v1.ListProductsResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ListProductsResponse.products: object expected"); + message.products[i] = $root.google.cloud.vision.v1.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1.ListProductsResponse} message ListProductsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.vision.v1.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListProductsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsResponse; + })(); + + v1.GetProductRequest = (function() { + + /** + * Properties of a GetProductRequest. + * @memberof google.cloud.vision.v1 + * @interface IGetProductRequest + * @property {string|null} [name] GetProductRequest name + */ + + /** + * Constructs a new GetProductRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a GetProductRequest. + * @implements IGetProductRequest + * @constructor + * @param {google.cloud.vision.v1.IGetProductRequest=} [properties] Properties to set + */ + function GetProductRequest(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]]; + } + + /** + * GetProductRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.GetProductRequest + * @instance + */ + GetProductRequest.prototype.name = ""; + + /** + * Creates a new GetProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {google.cloud.vision.v1.IGetProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.GetProductRequest} GetProductRequest instance + */ + GetProductRequest.create = function create(properties) { + return new GetProductRequest(properties); + }; + + /** + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.vision.v1.GetProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {google.cloud.vision.v1.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductRequest.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 GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GetProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {google.cloud.vision.v1.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductRequest.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.vision.v1.GetProductRequest(); + 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 GetProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProductRequest.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 GetProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.GetProductRequest} GetProductRequest + */ + GetProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.GetProductRequest) + return object; + var message = new $root.google.cloud.vision.v1.GetProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.GetProductRequest + * @static + * @param {google.cloud.vision.v1.GetProductRequest} message GetProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProductRequest.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 GetProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.GetProductRequest + * @instance + * @returns {Object.} JSON object + */ + GetProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProductRequest; + })(); + + v1.UpdateProductRequest = (function() { + + /** + * Properties of an UpdateProductRequest. + * @memberof google.cloud.vision.v1 + * @interface IUpdateProductRequest + * @property {google.cloud.vision.v1.IProduct|null} [product] UpdateProductRequest product + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask + */ + + /** + * Constructs a new UpdateProductRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an UpdateProductRequest. + * @implements IUpdateProductRequest + * @constructor + * @param {google.cloud.vision.v1.IUpdateProductRequest=} [properties] Properties to set + */ + function UpdateProductRequest(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]]; + } + + /** + * UpdateProductRequest product. + * @member {google.cloud.vision.v1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @instance + */ + UpdateProductRequest.prototype.product = null; + + /** + * UpdateProductRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @instance + */ + UpdateProductRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1.IUpdateProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.UpdateProductRequest} UpdateProductRequest instance + */ + UpdateProductRequest.create = function create(properties) { + return new UpdateProductRequest(properties); + }; + + /** + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.vision.v1.UpdateProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1.Product.encode(message.product, 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 UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.UpdateProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductRequest.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.vision.v1.UpdateProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.vision.v1.Product.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProductRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1.Product.verify(message.product); + if (error) + return "product." + 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.UpdateProductRequest} UpdateProductRequest + */ + UpdateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.UpdateProductRequest) + return object; + var message = new $root.google.cloud.vision.v1.UpdateProductRequest(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1.UpdateProductRequest.product: object expected"); + message.product = $root.google.cloud.vision.v1.Product.fromObject(object.product); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vision.v1.UpdateProductRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1.UpdateProductRequest} message UpdateProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.updateMask = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1.Product.toObject(message.product, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.UpdateProductRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateProductRequest; + })(); + + v1.DeleteProductRequest = (function() { + + /** + * Properties of a DeleteProductRequest. + * @memberof google.cloud.vision.v1 + * @interface IDeleteProductRequest + * @property {string|null} [name] DeleteProductRequest name + */ + + /** + * Constructs a new DeleteProductRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a DeleteProductRequest. + * @implements IDeleteProductRequest + * @constructor + * @param {google.cloud.vision.v1.IDeleteProductRequest=} [properties] Properties to set + */ + function DeleteProductRequest(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]]; + } + + /** + * DeleteProductRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @instance + */ + DeleteProductRequest.prototype.name = ""; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1.IDeleteProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.DeleteProductRequest} DeleteProductRequest instance + */ + DeleteProductRequest.create = function create(properties) { + return new DeleteProductRequest(properties); + }; + + /** + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.vision.v1.DeleteProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductRequest.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 DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DeleteProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.DeleteProductRequest} DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductRequest.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.vision.v1.DeleteProductRequest(); + 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 DeleteProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.DeleteProductRequest} DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProductRequest.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 DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.DeleteProductRequest} DeleteProductRequest + */ + DeleteProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.DeleteProductRequest) + return object; + var message = new $root.google.cloud.vision.v1.DeleteProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1.DeleteProductRequest} message DeleteProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProductRequest.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 DeleteProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.DeleteProductRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteProductRequest; + })(); + + v1.CreateProductSetRequest = (function() { + + /** + * Properties of a CreateProductSetRequest. + * @memberof google.cloud.vision.v1 + * @interface ICreateProductSetRequest + * @property {string|null} [parent] CreateProductSetRequest parent + * @property {google.cloud.vision.v1.IProductSet|null} [productSet] CreateProductSetRequest productSet + * @property {string|null} [productSetId] CreateProductSetRequest productSetId + */ + + /** + * Constructs a new CreateProductSetRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a CreateProductSetRequest. + * @implements ICreateProductSetRequest + * @constructor + * @param {google.cloud.vision.v1.ICreateProductSetRequest=} [properties] Properties to set + */ + function CreateProductSetRequest(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]]; + } + + /** + * CreateProductSetRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.parent = ""; + + /** + * CreateProductSetRequest productSet. + * @member {google.cloud.vision.v1.IProductSet|null|undefined} productSet + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.productSet = null; + + /** + * CreateProductSetRequest productSetId. + * @member {string} productSetId + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.productSetId = ""; + + /** + * Creates a new CreateProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1.ICreateProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.CreateProductSetRequest} CreateProductSetRequest instance + */ + CreateProductSetRequest.create = function create(properties) { + return new CreateProductSetRequest(properties); + }; + + /** + * Encodes the specified CreateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.CreateProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1.ICreateProductSetRequest} message CreateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductSetRequest.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.productSet != null && message.hasOwnProperty("productSet")) + $root.google.cloud.vision.v1.ProductSet.encode(message.productSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productSetId); + return writer; + }; + + /** + * Encodes the specified CreateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CreateProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1.ICreateProductSetRequest} message CreateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.CreateProductSetRequest} CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductSetRequest.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.vision.v1.CreateProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.productSet = $root.google.cloud.vision.v1.ProductSet.decode(reader, reader.uint32()); + break; + case 3: + message.productSetId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.CreateProductSetRequest} CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProductSetRequest.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.productSet != null && message.hasOwnProperty("productSet")) { + var error = $root.google.cloud.vision.v1.ProductSet.verify(message.productSet); + if (error) + return "productSet." + error; + } + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + if (!$util.isString(message.productSetId)) + return "productSetId: string expected"; + return null; + }; + + /** + * Creates a CreateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.CreateProductSetRequest} CreateProductSetRequest + */ + CreateProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.CreateProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1.CreateProductSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.productSet != null) { + if (typeof object.productSet !== "object") + throw TypeError(".google.cloud.vision.v1.CreateProductSetRequest.productSet: object expected"); + message.productSet = $root.google.cloud.vision.v1.ProductSet.fromObject(object.productSet); + } + if (object.productSetId != null) + message.productSetId = String(object.productSetId); + return message; + }; + + /** + * Creates a plain object from a CreateProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1.CreateProductSetRequest} message CreateProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.productSet = null; + object.productSetId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = $root.google.cloud.vision.v1.ProductSet.toObject(message.productSet, options); + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + object.productSetId = message.productSetId; + return object; + }; + + /** + * Converts this CreateProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.CreateProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateProductSetRequest; + })(); + + v1.ListProductSetsRequest = (function() { + + /** + * Properties of a ListProductSetsRequest. + * @memberof google.cloud.vision.v1 + * @interface IListProductSetsRequest + * @property {string|null} [parent] ListProductSetsRequest parent + * @property {number|null} [pageSize] ListProductSetsRequest pageSize + * @property {string|null} [pageToken] ListProductSetsRequest pageToken + */ + + /** + * Constructs a new ListProductSetsRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListProductSetsRequest. + * @implements IListProductSetsRequest + * @constructor + * @param {google.cloud.vision.v1.IListProductSetsRequest=} [properties] Properties to set + */ + function ListProductSetsRequest(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]]; + } + + /** + * ListProductSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.parent = ""; + + /** + * ListProductSetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.pageSize = 0; + + /** + * ListProductSetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1.IListProductSetsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListProductSetsRequest} ListProductSetsRequest instance + */ + ListProductSetsRequest.create = function create(properties) { + return new ListProductSetsRequest(properties); + }; + + /** + * Encodes the specified ListProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1.IListProductSetsRequest} message ListProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1.IListProductSetsRequest} message ListProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListProductSetsRequest} ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsRequest.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.vision.v1.ListProductSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListProductSetsRequest} ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductSetsRequest message. + * @function verify + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductSetsRequest.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.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 ListProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListProductSetsRequest} ListProductSetsRequest + */ + ListProductSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListProductSetsRequest) + return object; + var message = new $root.google.cloud.vision.v1.ListProductSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1.ListProductSetsRequest} message ListProductSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProductSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListProductSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductSetsRequest; + })(); + + v1.ListProductSetsResponse = (function() { + + /** + * Properties of a ListProductSetsResponse. + * @memberof google.cloud.vision.v1 + * @interface IListProductSetsResponse + * @property {Array.|null} [productSets] ListProductSetsResponse productSets + * @property {string|null} [nextPageToken] ListProductSetsResponse nextPageToken + */ + + /** + * Constructs a new ListProductSetsResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListProductSetsResponse. + * @implements IListProductSetsResponse + * @constructor + * @param {google.cloud.vision.v1.IListProductSetsResponse=} [properties] Properties to set + */ + function ListProductSetsResponse(properties) { + this.productSets = []; + 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]]; + } + + /** + * ListProductSetsResponse productSets. + * @member {Array.} productSets + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @instance + */ + ListProductSetsResponse.prototype.productSets = $util.emptyArray; + + /** + * ListProductSetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @instance + */ + ListProductSetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1.IListProductSetsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListProductSetsResponse} ListProductSetsResponse instance + */ + ListProductSetsResponse.create = function create(properties) { + return new ListProductSetsResponse(properties); + }; + + /** + * Encodes the specified ListProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1.IListProductSetsResponse} message ListProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSets != null && message.productSets.length) + for (var i = 0; i < message.productSets.length; ++i) + $root.google.cloud.vision.v1.ProductSet.encode(message.productSets[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 ListProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1.IListProductSetsResponse} message ListProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListProductSetsResponse} ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsResponse.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.vision.v1.ListProductSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.productSets && message.productSets.length)) + message.productSets = []; + message.productSets.push($root.google.cloud.vision.v1.ProductSet.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListProductSetsResponse} ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductSetsResponse message. + * @function verify + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productSets != null && message.hasOwnProperty("productSets")) { + if (!Array.isArray(message.productSets)) + return "productSets: array expected"; + for (var i = 0; i < message.productSets.length; ++i) { + var error = $root.google.cloud.vision.v1.ProductSet.verify(message.productSets[i]); + if (error) + return "productSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListProductSetsResponse} ListProductSetsResponse + */ + ListProductSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListProductSetsResponse) + return object; + var message = new $root.google.cloud.vision.v1.ListProductSetsResponse(); + if (object.productSets) { + if (!Array.isArray(object.productSets)) + throw TypeError(".google.cloud.vision.v1.ListProductSetsResponse.productSets: array expected"); + message.productSets = []; + for (var i = 0; i < object.productSets.length; ++i) { + if (typeof object.productSets[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ListProductSetsResponse.productSets: object expected"); + message.productSets[i] = $root.google.cloud.vision.v1.ProductSet.fromObject(object.productSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1.ListProductSetsResponse} message ListProductSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.productSets && message.productSets.length) { + object.productSets = []; + for (var j = 0; j < message.productSets.length; ++j) + object.productSets[j] = $root.google.cloud.vision.v1.ProductSet.toObject(message.productSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListProductSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductSetsResponse; + })(); + + v1.GetProductSetRequest = (function() { + + /** + * Properties of a GetProductSetRequest. + * @memberof google.cloud.vision.v1 + * @interface IGetProductSetRequest + * @property {string|null} [name] GetProductSetRequest name + */ + + /** + * Constructs a new GetProductSetRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a GetProductSetRequest. + * @implements IGetProductSetRequest + * @constructor + * @param {google.cloud.vision.v1.IGetProductSetRequest=} [properties] Properties to set + */ + function GetProductSetRequest(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]]; + } + + /** + * GetProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @instance + */ + GetProductSetRequest.prototype.name = ""; + + /** + * Creates a new GetProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1.IGetProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.GetProductSetRequest} GetProductSetRequest instance + */ + GetProductSetRequest.create = function create(properties) { + return new GetProductSetRequest(properties); + }; + + /** + * Encodes the specified GetProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.GetProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1.IGetProductSetRequest} message GetProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductSetRequest.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 GetProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GetProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1.IGetProductSetRequest} message GetProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.GetProductSetRequest} GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductSetRequest.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.vision.v1.GetProductSetRequest(); + 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 GetProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.GetProductSetRequest} GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProductSetRequest.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 GetProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.GetProductSetRequest} GetProductSetRequest + */ + GetProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.GetProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1.GetProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1.GetProductSetRequest} message GetProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProductSetRequest.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 GetProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.GetProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProductSetRequest; + })(); + + v1.UpdateProductSetRequest = (function() { + + /** + * Properties of an UpdateProductSetRequest. + * @memberof google.cloud.vision.v1 + * @interface IUpdateProductSetRequest + * @property {google.cloud.vision.v1.IProductSet|null} [productSet] UpdateProductSetRequest productSet + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductSetRequest updateMask + */ + + /** + * Constructs a new UpdateProductSetRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an UpdateProductSetRequest. + * @implements IUpdateProductSetRequest + * @constructor + * @param {google.cloud.vision.v1.IUpdateProductSetRequest=} [properties] Properties to set + */ + function UpdateProductSetRequest(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]]; + } + + /** + * UpdateProductSetRequest productSet. + * @member {google.cloud.vision.v1.IProductSet|null|undefined} productSet + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @instance + */ + UpdateProductSetRequest.prototype.productSet = null; + + /** + * UpdateProductSetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @instance + */ + UpdateProductSetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1.IUpdateProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.UpdateProductSetRequest} UpdateProductSetRequest instance + */ + UpdateProductSetRequest.create = function create(properties) { + return new UpdateProductSetRequest(properties); + }; + + /** + * Encodes the specified UpdateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.UpdateProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1.IUpdateProductSetRequest} message UpdateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSet != null && message.hasOwnProperty("productSet")) + $root.google.cloud.vision.v1.ProductSet.encode(message.productSet, 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 UpdateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.UpdateProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1.IUpdateProductSetRequest} message UpdateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.UpdateProductSetRequest} UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductSetRequest.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.vision.v1.UpdateProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productSet = $root.google.cloud.vision.v1.ProductSet.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.UpdateProductSetRequest} UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProductSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productSet != null && message.hasOwnProperty("productSet")) { + var error = $root.google.cloud.vision.v1.ProductSet.verify(message.productSet); + if (error) + return "productSet." + 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 UpdateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.UpdateProductSetRequest} UpdateProductSetRequest + */ + UpdateProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.UpdateProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1.UpdateProductSetRequest(); + if (object.productSet != null) { + if (typeof object.productSet !== "object") + throw TypeError(".google.cloud.vision.v1.UpdateProductSetRequest.productSet: object expected"); + message.productSet = $root.google.cloud.vision.v1.ProductSet.fromObject(object.productSet); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vision.v1.UpdateProductSetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1.UpdateProductSetRequest} message UpdateProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.productSet = null; + object.updateMask = null; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = $root.google.cloud.vision.v1.ProductSet.toObject(message.productSet, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.UpdateProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateProductSetRequest; + })(); + + v1.DeleteProductSetRequest = (function() { + + /** + * Properties of a DeleteProductSetRequest. + * @memberof google.cloud.vision.v1 + * @interface IDeleteProductSetRequest + * @property {string|null} [name] DeleteProductSetRequest name + */ + + /** + * Constructs a new DeleteProductSetRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a DeleteProductSetRequest. + * @implements IDeleteProductSetRequest + * @constructor + * @param {google.cloud.vision.v1.IDeleteProductSetRequest=} [properties] Properties to set + */ + function DeleteProductSetRequest(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]]; + } + + /** + * DeleteProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @instance + */ + DeleteProductSetRequest.prototype.name = ""; + + /** + * Creates a new DeleteProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1.IDeleteProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.DeleteProductSetRequest} DeleteProductSetRequest instance + */ + DeleteProductSetRequest.create = function create(properties) { + return new DeleteProductSetRequest(properties); + }; + + /** + * Encodes the specified DeleteProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.DeleteProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1.IDeleteProductSetRequest} message DeleteProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductSetRequest.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 DeleteProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DeleteProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1.IDeleteProductSetRequest} message DeleteProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.DeleteProductSetRequest} DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductSetRequest.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.vision.v1.DeleteProductSetRequest(); + 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 DeleteProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.DeleteProductSetRequest} DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProductSetRequest.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 DeleteProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.DeleteProductSetRequest} DeleteProductSetRequest + */ + DeleteProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.DeleteProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1.DeleteProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1.DeleteProductSetRequest} message DeleteProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProductSetRequest.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 DeleteProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.DeleteProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteProductSetRequest; + })(); + + v1.CreateReferenceImageRequest = (function() { + + /** + * Properties of a CreateReferenceImageRequest. + * @memberof google.cloud.vision.v1 + * @interface ICreateReferenceImageRequest + * @property {string|null} [parent] CreateReferenceImageRequest parent + * @property {google.cloud.vision.v1.IReferenceImage|null} [referenceImage] CreateReferenceImageRequest referenceImage + * @property {string|null} [referenceImageId] CreateReferenceImageRequest referenceImageId + */ + + /** + * Constructs a new CreateReferenceImageRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a CreateReferenceImageRequest. + * @implements ICreateReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1.ICreateReferenceImageRequest=} [properties] Properties to set + */ + function CreateReferenceImageRequest(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]]; + } + + /** + * CreateReferenceImageRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.parent = ""; + + /** + * CreateReferenceImageRequest referenceImage. + * @member {google.cloud.vision.v1.IReferenceImage|null|undefined} referenceImage + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.referenceImage = null; + + /** + * CreateReferenceImageRequest referenceImageId. + * @member {string} referenceImageId + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.referenceImageId = ""; + + /** + * Creates a new CreateReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.ICreateReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.CreateReferenceImageRequest} CreateReferenceImageRequest instance + */ + CreateReferenceImageRequest.create = function create(properties) { + return new CreateReferenceImageRequest(properties); + }; + + /** + * Encodes the specified CreateReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1.CreateReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.ICreateReferenceImageRequest} message CreateReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReferenceImageRequest.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.referenceImage != null && message.hasOwnProperty("referenceImage")) + $root.google.cloud.vision.v1.ReferenceImage.encode(message.referenceImage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.referenceImageId); + return writer; + }; + + /** + * Encodes the specified CreateReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.CreateReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.ICreateReferenceImageRequest} message CreateReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.CreateReferenceImageRequest} CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReferenceImageRequest.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.vision.v1.CreateReferenceImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.referenceImage = $root.google.cloud.vision.v1.ReferenceImage.decode(reader, reader.uint32()); + break; + case 3: + message.referenceImageId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.CreateReferenceImageRequest} CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReferenceImageRequest.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.referenceImage != null && message.hasOwnProperty("referenceImage")) { + var error = $root.google.cloud.vision.v1.ReferenceImage.verify(message.referenceImage); + if (error) + return "referenceImage." + error; + } + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + if (!$util.isString(message.referenceImageId)) + return "referenceImageId: string expected"; + return null; + }; + + /** + * Creates a CreateReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.CreateReferenceImageRequest} CreateReferenceImageRequest + */ + CreateReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.CreateReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1.CreateReferenceImageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.referenceImage != null) { + if (typeof object.referenceImage !== "object") + throw TypeError(".google.cloud.vision.v1.CreateReferenceImageRequest.referenceImage: object expected"); + message.referenceImage = $root.google.cloud.vision.v1.ReferenceImage.fromObject(object.referenceImage); + } + if (object.referenceImageId != null) + message.referenceImageId = String(object.referenceImageId); + return message; + }; + + /** + * Creates a plain object from a CreateReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.CreateReferenceImageRequest} message CreateReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReferenceImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.referenceImage = null; + object.referenceImageId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.referenceImage != null && message.hasOwnProperty("referenceImage")) + object.referenceImage = $root.google.cloud.vision.v1.ReferenceImage.toObject(message.referenceImage, options); + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + object.referenceImageId = message.referenceImageId; + return object; + }; + + /** + * Converts this CreateReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.CreateReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateReferenceImageRequest; + })(); + + v1.ListReferenceImagesRequest = (function() { + + /** + * Properties of a ListReferenceImagesRequest. + * @memberof google.cloud.vision.v1 + * @interface IListReferenceImagesRequest + * @property {string|null} [parent] ListReferenceImagesRequest parent + * @property {number|null} [pageSize] ListReferenceImagesRequest pageSize + * @property {string|null} [pageToken] ListReferenceImagesRequest pageToken + */ + + /** + * Constructs a new ListReferenceImagesRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListReferenceImagesRequest. + * @implements IListReferenceImagesRequest + * @constructor + * @param {google.cloud.vision.v1.IListReferenceImagesRequest=} [properties] Properties to set + */ + function ListReferenceImagesRequest(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]]; + } + + /** + * ListReferenceImagesRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.parent = ""; + + /** + * ListReferenceImagesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.pageSize = 0; + + /** + * ListReferenceImagesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListReferenceImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1.IListReferenceImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListReferenceImagesRequest} ListReferenceImagesRequest instance + */ + ListReferenceImagesRequest.create = function create(properties) { + return new ListReferenceImagesRequest(properties); + }; + + /** + * Encodes the specified ListReferenceImagesRequest message. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1.IListReferenceImagesRequest} message ListReferenceImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListReferenceImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1.IListReferenceImagesRequest} message ListReferenceImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListReferenceImagesRequest} ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesRequest.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.vision.v1.ListReferenceImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListReferenceImagesRequest} ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReferenceImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReferenceImagesRequest.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.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 ListReferenceImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListReferenceImagesRequest} ListReferenceImagesRequest + */ + ListReferenceImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListReferenceImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1.ListReferenceImagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListReferenceImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1.ListReferenceImagesRequest} message ListReferenceImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReferenceImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListReferenceImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListReferenceImagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListReferenceImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReferenceImagesRequest; + })(); + + v1.ListReferenceImagesResponse = (function() { + + /** + * Properties of a ListReferenceImagesResponse. + * @memberof google.cloud.vision.v1 + * @interface IListReferenceImagesResponse + * @property {Array.|null} [referenceImages] ListReferenceImagesResponse referenceImages + * @property {number|null} [pageSize] ListReferenceImagesResponse pageSize + * @property {string|null} [nextPageToken] ListReferenceImagesResponse nextPageToken + */ + + /** + * Constructs a new ListReferenceImagesResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListReferenceImagesResponse. + * @implements IListReferenceImagesResponse + * @constructor + * @param {google.cloud.vision.v1.IListReferenceImagesResponse=} [properties] Properties to set + */ + function ListReferenceImagesResponse(properties) { + this.referenceImages = []; + 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]]; + } + + /** + * ListReferenceImagesResponse referenceImages. + * @member {Array.} referenceImages + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.referenceImages = $util.emptyArray; + + /** + * ListReferenceImagesResponse pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.pageSize = 0; + + /** + * ListReferenceImagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReferenceImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1.IListReferenceImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListReferenceImagesResponse} ListReferenceImagesResponse instance + */ + ListReferenceImagesResponse.create = function create(properties) { + return new ListReferenceImagesResponse(properties); + }; + + /** + * Encodes the specified ListReferenceImagesResponse message. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1.IListReferenceImagesResponse} message ListReferenceImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceImages != null && message.referenceImages.length) + for (var i = 0; i < message.referenceImages.length; ++i) + $root.google.cloud.vision.v1.ReferenceImage.encode(message.referenceImages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListReferenceImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListReferenceImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1.IListReferenceImagesResponse} message ListReferenceImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListReferenceImagesResponse} ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesResponse.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.vision.v1.ListReferenceImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.referenceImages && message.referenceImages.length)) + message.referenceImages = []; + message.referenceImages.push($root.google.cloud.vision.v1.ReferenceImage.decode(reader, reader.uint32())); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListReferenceImagesResponse} ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReferenceImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReferenceImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceImages != null && message.hasOwnProperty("referenceImages")) { + if (!Array.isArray(message.referenceImages)) + return "referenceImages: array expected"; + for (var i = 0; i < message.referenceImages.length; ++i) { + var error = $root.google.cloud.vision.v1.ReferenceImage.verify(message.referenceImages[i]); + if (error) + return "referenceImages." + error; + } + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReferenceImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListReferenceImagesResponse} ListReferenceImagesResponse + */ + ListReferenceImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListReferenceImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1.ListReferenceImagesResponse(); + if (object.referenceImages) { + if (!Array.isArray(object.referenceImages)) + throw TypeError(".google.cloud.vision.v1.ListReferenceImagesResponse.referenceImages: array expected"); + message.referenceImages = []; + for (var i = 0; i < object.referenceImages.length; ++i) { + if (typeof object.referenceImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ListReferenceImagesResponse.referenceImages: object expected"); + message.referenceImages[i] = $root.google.cloud.vision.v1.ReferenceImage.fromObject(object.referenceImages[i]); + } + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReferenceImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1.ListReferenceImagesResponse} message ListReferenceImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReferenceImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.referenceImages = []; + if (options.defaults) { + object.pageSize = 0; + object.nextPageToken = ""; + } + if (message.referenceImages && message.referenceImages.length) { + object.referenceImages = []; + for (var j = 0; j < message.referenceImages.length; ++j) + object.referenceImages[j] = $root.google.cloud.vision.v1.ReferenceImage.toObject(message.referenceImages[j], options); + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReferenceImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListReferenceImagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListReferenceImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReferenceImagesResponse; + })(); + + v1.GetReferenceImageRequest = (function() { + + /** + * Properties of a GetReferenceImageRequest. + * @memberof google.cloud.vision.v1 + * @interface IGetReferenceImageRequest + * @property {string|null} [name] GetReferenceImageRequest name + */ + + /** + * Constructs a new GetReferenceImageRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a GetReferenceImageRequest. + * @implements IGetReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1.IGetReferenceImageRequest=} [properties] Properties to set + */ + function GetReferenceImageRequest(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]]; + } + + /** + * GetReferenceImageRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @instance + */ + GetReferenceImageRequest.prototype.name = ""; + + /** + * Creates a new GetReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.IGetReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.GetReferenceImageRequest} GetReferenceImageRequest instance + */ + GetReferenceImageRequest.create = function create(properties) { + return new GetReferenceImageRequest(properties); + }; + + /** + * Encodes the specified GetReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1.GetReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.IGetReferenceImageRequest} message GetReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReferenceImageRequest.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 GetReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.GetReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.IGetReferenceImageRequest} message GetReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.GetReferenceImageRequest} GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReferenceImageRequest.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.vision.v1.GetReferenceImageRequest(); + 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 GetReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.GetReferenceImageRequest} GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReferenceImageRequest.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 GetReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.GetReferenceImageRequest} GetReferenceImageRequest + */ + GetReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.GetReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1.GetReferenceImageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.GetReferenceImageRequest} message GetReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReferenceImageRequest.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 GetReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.GetReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + GetReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetReferenceImageRequest; + })(); + + v1.DeleteReferenceImageRequest = (function() { + + /** + * Properties of a DeleteReferenceImageRequest. + * @memberof google.cloud.vision.v1 + * @interface IDeleteReferenceImageRequest + * @property {string|null} [name] DeleteReferenceImageRequest name + */ + + /** + * Constructs a new DeleteReferenceImageRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a DeleteReferenceImageRequest. + * @implements IDeleteReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1.IDeleteReferenceImageRequest=} [properties] Properties to set + */ + function DeleteReferenceImageRequest(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]]; + } + + /** + * DeleteReferenceImageRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @instance + */ + DeleteReferenceImageRequest.prototype.name = ""; + + /** + * Creates a new DeleteReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.IDeleteReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.DeleteReferenceImageRequest} DeleteReferenceImageRequest instance + */ + DeleteReferenceImageRequest.create = function create(properties) { + return new DeleteReferenceImageRequest(properties); + }; + + /** + * Encodes the specified DeleteReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1.DeleteReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.IDeleteReferenceImageRequest} message DeleteReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.DeleteReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.IDeleteReferenceImageRequest} message DeleteReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReferenceImageRequest.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.vision.v1.DeleteReferenceImageRequest(); + 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 DeleteReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + */ + DeleteReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.DeleteReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1.DeleteReferenceImageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1.DeleteReferenceImageRequest} message DeleteReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.DeleteReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteReferenceImageRequest; + })(); + + v1.AddProductToProductSetRequest = (function() { + + /** + * Properties of an AddProductToProductSetRequest. + * @memberof google.cloud.vision.v1 + * @interface IAddProductToProductSetRequest + * @property {string|null} [name] AddProductToProductSetRequest name + * @property {string|null} [product] AddProductToProductSetRequest product + */ + + /** + * Constructs a new AddProductToProductSetRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an AddProductToProductSetRequest. + * @implements IAddProductToProductSetRequest + * @constructor + * @param {google.cloud.vision.v1.IAddProductToProductSetRequest=} [properties] Properties to set + */ + function AddProductToProductSetRequest(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]]; + } + + /** + * AddProductToProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @instance + */ + AddProductToProductSetRequest.prototype.name = ""; + + /** + * AddProductToProductSetRequest product. + * @member {string} product + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @instance + */ + AddProductToProductSetRequest.prototype.product = ""; + + /** + * Creates a new AddProductToProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1.IAddProductToProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.AddProductToProductSetRequest} AddProductToProductSetRequest instance + */ + AddProductToProductSetRequest.create = function create(properties) { + return new AddProductToProductSetRequest(properties); + }; + + /** + * Encodes the specified AddProductToProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.AddProductToProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1.IAddProductToProductSetRequest} message AddProductToProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddProductToProductSetRequest.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.product != null && message.hasOwnProperty("product")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.product); + return writer; + }; + + /** + * Encodes the specified AddProductToProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.AddProductToProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1.IAddProductToProductSetRequest} message AddProductToProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddProductToProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.AddProductToProductSetRequest} AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddProductToProductSetRequest.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.vision.v1.AddProductToProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.product = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.AddProductToProductSetRequest} AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddProductToProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddProductToProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddProductToProductSetRequest.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.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + return null; + }; + + /** + * Creates an AddProductToProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.AddProductToProductSetRequest} AddProductToProductSetRequest + */ + AddProductToProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.AddProductToProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1.AddProductToProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.product != null) + message.product = String(object.product); + return message; + }; + + /** + * Creates a plain object from an AddProductToProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1.AddProductToProductSetRequest} message AddProductToProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddProductToProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.product = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + return object; + }; + + /** + * Converts this AddProductToProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.AddProductToProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + AddProductToProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddProductToProductSetRequest; + })(); + + v1.RemoveProductFromProductSetRequest = (function() { + + /** + * Properties of a RemoveProductFromProductSetRequest. + * @memberof google.cloud.vision.v1 + * @interface IRemoveProductFromProductSetRequest + * @property {string|null} [name] RemoveProductFromProductSetRequest name + * @property {string|null} [product] RemoveProductFromProductSetRequest product + */ + + /** + * Constructs a new RemoveProductFromProductSetRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a RemoveProductFromProductSetRequest. + * @implements IRemoveProductFromProductSetRequest + * @constructor + * @param {google.cloud.vision.v1.IRemoveProductFromProductSetRequest=} [properties] Properties to set + */ + function RemoveProductFromProductSetRequest(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]]; + } + + /** + * RemoveProductFromProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @instance + */ + RemoveProductFromProductSetRequest.prototype.name = ""; + + /** + * RemoveProductFromProductSetRequest product. + * @member {string} product + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @instance + */ + RemoveProductFromProductSetRequest.prototype.product = ""; + + /** + * Creates a new RemoveProductFromProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1.IRemoveProductFromProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest instance + */ + RemoveProductFromProductSetRequest.create = function create(properties) { + return new RemoveProductFromProductSetRequest(properties); + }; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1.IRemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveProductFromProductSetRequest.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.product != null && message.hasOwnProperty("product")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.product); + return writer; + }; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1.IRemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveProductFromProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveProductFromProductSetRequest.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.vision.v1.RemoveProductFromProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.product = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveProductFromProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveProductFromProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveProductFromProductSetRequest.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.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + return null; + }; + + /** + * Creates a RemoveProductFromProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + */ + RemoveProductFromProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.RemoveProductFromProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1.RemoveProductFromProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.product != null) + message.product = String(object.product); + return message; + }; + + /** + * Creates a plain object from a RemoveProductFromProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1.RemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveProductFromProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.product = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + return object; + }; + + /** + * Converts this RemoveProductFromProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.RemoveProductFromProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveProductFromProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveProductFromProductSetRequest; + })(); + + v1.ListProductsInProductSetRequest = (function() { + + /** + * Properties of a ListProductsInProductSetRequest. + * @memberof google.cloud.vision.v1 + * @interface IListProductsInProductSetRequest + * @property {string|null} [name] ListProductsInProductSetRequest name + * @property {number|null} [pageSize] ListProductsInProductSetRequest pageSize + * @property {string|null} [pageToken] ListProductsInProductSetRequest pageToken + */ + + /** + * Constructs a new ListProductsInProductSetRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListProductsInProductSetRequest. + * @implements IListProductsInProductSetRequest + * @constructor + * @param {google.cloud.vision.v1.IListProductsInProductSetRequest=} [properties] Properties to set + */ + function ListProductsInProductSetRequest(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]]; + } + + /** + * ListProductsInProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.name = ""; + + /** + * ListProductsInProductSetRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.pageSize = 0; + + /** + * ListProductsInProductSetRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductsInProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1.IListProductsInProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListProductsInProductSetRequest} ListProductsInProductSetRequest instance + */ + ListProductsInProductSetRequest.create = function create(properties) { + return new ListProductsInProductSetRequest(properties); + }; + + /** + * Encodes the specified ListProductsInProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1.IListProductsInProductSetRequest} message ListProductsInProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductsInProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1.IListProductsInProductSetRequest} message ListProductsInProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetRequest.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.vision.v1.ListProductsInProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsInProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsInProductSetRequest.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.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 ListProductsInProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + */ + ListProductsInProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListProductsInProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1.ListProductsInProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListProductsInProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1.ListProductsInProductSetRequest} message ListProductsInProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsInProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 ListProductsInProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListProductsInProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductsInProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsInProductSetRequest; + })(); + + v1.ListProductsInProductSetResponse = (function() { + + /** + * Properties of a ListProductsInProductSetResponse. + * @memberof google.cloud.vision.v1 + * @interface IListProductsInProductSetResponse + * @property {Array.|null} [products] ListProductsInProductSetResponse products + * @property {string|null} [nextPageToken] ListProductsInProductSetResponse nextPageToken + */ + + /** + * Constructs a new ListProductsInProductSetResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ListProductsInProductSetResponse. + * @implements IListProductsInProductSetResponse + * @constructor + * @param {google.cloud.vision.v1.IListProductsInProductSetResponse=} [properties] Properties to set + */ + function ListProductsInProductSetResponse(properties) { + this.products = []; + 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]]; + } + + /** + * ListProductsInProductSetResponse products. + * @member {Array.} products + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @instance + */ + ListProductsInProductSetResponse.prototype.products = $util.emptyArray; + + /** + * ListProductsInProductSetResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @instance + */ + ListProductsInProductSetResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductsInProductSetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1.IListProductsInProductSetResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ListProductsInProductSetResponse} ListProductsInProductSetResponse instance + */ + ListProductsInProductSetResponse.create = function create(properties) { + return new ListProductsInProductSetResponse(properties); + }; + + /** + * Encodes the specified ListProductsInProductSetResponse message. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1.IListProductsInProductSetResponse} message ListProductsInProductSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.vision.v1.Product.encode(message.products[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 ListProductsInProductSetResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ListProductsInProductSetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1.IListProductsInProductSetResponse} message ListProductsInProductSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetResponse.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.vision.v1.ListProductsInProductSetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.vision.v1.Product.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsInProductSetResponse message. + * @function verify + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsInProductSetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.vision.v1.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductsInProductSetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + */ + ListProductsInProductSetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ListProductsInProductSetResponse) + return object; + var message = new $root.google.cloud.vision.v1.ListProductsInProductSetResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.vision.v1.ListProductsInProductSetResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ListProductsInProductSetResponse.products: object expected"); + message.products[i] = $root.google.cloud.vision.v1.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsInProductSetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1.ListProductsInProductSetResponse} message ListProductsInProductSetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsInProductSetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.vision.v1.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductsInProductSetResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ListProductsInProductSetResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductsInProductSetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsInProductSetResponse; + })(); + + v1.ImportProductSetsGcsSource = (function() { + + /** + * Properties of an ImportProductSetsGcsSource. + * @memberof google.cloud.vision.v1 + * @interface IImportProductSetsGcsSource + * @property {string|null} [csvFileUri] ImportProductSetsGcsSource csvFileUri + */ + + /** + * Constructs a new ImportProductSetsGcsSource. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImportProductSetsGcsSource. + * @implements IImportProductSetsGcsSource + * @constructor + * @param {google.cloud.vision.v1.IImportProductSetsGcsSource=} [properties] Properties to set + */ + function ImportProductSetsGcsSource(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]]; + } + + /** + * ImportProductSetsGcsSource csvFileUri. + * @member {string} csvFileUri + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @instance + */ + ImportProductSetsGcsSource.prototype.csvFileUri = ""; + + /** + * Creates a new ImportProductSetsGcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1.IImportProductSetsGcsSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImportProductSetsGcsSource} ImportProductSetsGcsSource instance + */ + ImportProductSetsGcsSource.create = function create(properties) { + return new ImportProductSetsGcsSource(properties); + }; + + /** + * Encodes the specified ImportProductSetsGcsSource message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsGcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1.IImportProductSetsGcsSource} message ImportProductSetsGcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsGcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.csvFileUri); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsGcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsGcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1.IImportProductSetsGcsSource} message ImportProductSetsGcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsGcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsGcsSource.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.vision.v1.ImportProductSetsGcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.csvFileUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsGcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsGcsSource message. + * @function verify + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsGcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + if (!$util.isString(message.csvFileUri)) + return "csvFileUri: string expected"; + return null; + }; + + /** + * Creates an ImportProductSetsGcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + */ + ImportProductSetsGcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImportProductSetsGcsSource) + return object; + var message = new $root.google.cloud.vision.v1.ImportProductSetsGcsSource(); + if (object.csvFileUri != null) + message.csvFileUri = String(object.csvFileUri); + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsGcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1.ImportProductSetsGcsSource} message ImportProductSetsGcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsGcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.csvFileUri = ""; + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + object.csvFileUri = message.csvFileUri; + return object; + }; + + /** + * Converts this ImportProductSetsGcsSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImportProductSetsGcsSource + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsGcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsGcsSource; + })(); + + v1.ImportProductSetsInputConfig = (function() { + + /** + * Properties of an ImportProductSetsInputConfig. + * @memberof google.cloud.vision.v1 + * @interface IImportProductSetsInputConfig + * @property {google.cloud.vision.v1.IImportProductSetsGcsSource|null} [gcsSource] ImportProductSetsInputConfig gcsSource + */ + + /** + * Constructs a new ImportProductSetsInputConfig. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImportProductSetsInputConfig. + * @implements IImportProductSetsInputConfig + * @constructor + * @param {google.cloud.vision.v1.IImportProductSetsInputConfig=} [properties] Properties to set + */ + function ImportProductSetsInputConfig(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]]; + } + + /** + * ImportProductSetsInputConfig gcsSource. + * @member {google.cloud.vision.v1.IImportProductSetsGcsSource|null|undefined} gcsSource + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @instance + */ + ImportProductSetsInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportProductSetsInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @instance + */ + Object.defineProperty(ImportProductSetsInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportProductSetsInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1.IImportProductSetsInputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImportProductSetsInputConfig} ImportProductSetsInputConfig instance + */ + ImportProductSetsInputConfig.create = function create(properties) { + return new ImportProductSetsInputConfig(properties); + }; + + /** + * Encodes the specified ImportProductSetsInputConfig message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1.IImportProductSetsInputConfig} message ImportProductSetsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.vision.v1.ImportProductSetsGcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsInputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1.IImportProductSetsInputConfig} message ImportProductSetsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsInputConfig.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.vision.v1.ImportProductSetsInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.vision.v1.ImportProductSetsGcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsInputConfig message. + * @function verify + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsInputConfig.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.vision.v1.ImportProductSetsGcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates an ImportProductSetsInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + */ + ImportProductSetsInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImportProductSetsInputConfig) + return object; + var message = new $root.google.cloud.vision.v1.ImportProductSetsInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.vision.v1.ImportProductSetsInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.vision.v1.ImportProductSetsGcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1.ImportProductSetsInputConfig} message ImportProductSetsInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.vision.v1.ImportProductSetsGcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this ImportProductSetsInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImportProductSetsInputConfig + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsInputConfig; + })(); + + v1.ImportProductSetsRequest = (function() { + + /** + * Properties of an ImportProductSetsRequest. + * @memberof google.cloud.vision.v1 + * @interface IImportProductSetsRequest + * @property {string|null} [parent] ImportProductSetsRequest parent + * @property {google.cloud.vision.v1.IImportProductSetsInputConfig|null} [inputConfig] ImportProductSetsRequest inputConfig + */ + + /** + * Constructs a new ImportProductSetsRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImportProductSetsRequest. + * @implements IImportProductSetsRequest + * @constructor + * @param {google.cloud.vision.v1.IImportProductSetsRequest=} [properties] Properties to set + */ + function ImportProductSetsRequest(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]]; + } + + /** + * ImportProductSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @instance + */ + ImportProductSetsRequest.prototype.parent = ""; + + /** + * ImportProductSetsRequest inputConfig. + * @member {google.cloud.vision.v1.IImportProductSetsInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @instance + */ + ImportProductSetsRequest.prototype.inputConfig = null; + + /** + * Creates a new ImportProductSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1.IImportProductSetsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImportProductSetsRequest} ImportProductSetsRequest instance + */ + ImportProductSetsRequest.create = function create(properties) { + return new ImportProductSetsRequest(properties); + }; + + /** + * Encodes the specified ImportProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1.IImportProductSetsRequest} message ImportProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1.ImportProductSetsInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1.IImportProductSetsRequest} message ImportProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImportProductSetsRequest} ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsRequest.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.vision.v1.ImportProductSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.vision.v1.ImportProductSetsInputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImportProductSetsRequest} ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsRequest message. + * @function verify + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.vision.v1.ImportProductSetsInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + return null; + }; + + /** + * Creates an ImportProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImportProductSetsRequest} ImportProductSetsRequest + */ + ImportProductSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImportProductSetsRequest) + return object; + var message = new $root.google.cloud.vision.v1.ImportProductSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1.ImportProductSetsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1.ImportProductSetsInputConfig.fromObject(object.inputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1.ImportProductSetsRequest} message ImportProductSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1.ImportProductSetsInputConfig.toObject(message.inputConfig, options); + return object; + }; + + /** + * Converts this ImportProductSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImportProductSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsRequest; + })(); + + v1.ImportProductSetsResponse = (function() { + + /** + * Properties of an ImportProductSetsResponse. + * @memberof google.cloud.vision.v1 + * @interface IImportProductSetsResponse + * @property {Array.|null} [referenceImages] ImportProductSetsResponse referenceImages + * @property {Array.|null} [statuses] ImportProductSetsResponse statuses + */ + + /** + * Constructs a new ImportProductSetsResponse. + * @memberof google.cloud.vision.v1 + * @classdesc Represents an ImportProductSetsResponse. + * @implements IImportProductSetsResponse + * @constructor + * @param {google.cloud.vision.v1.IImportProductSetsResponse=} [properties] Properties to set + */ + function ImportProductSetsResponse(properties) { + this.referenceImages = []; + this.statuses = []; + 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]]; + } + + /** + * ImportProductSetsResponse referenceImages. + * @member {Array.} referenceImages + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @instance + */ + ImportProductSetsResponse.prototype.referenceImages = $util.emptyArray; + + /** + * ImportProductSetsResponse statuses. + * @member {Array.} statuses + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @instance + */ + ImportProductSetsResponse.prototype.statuses = $util.emptyArray; + + /** + * Creates a new ImportProductSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1.IImportProductSetsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ImportProductSetsResponse} ImportProductSetsResponse instance + */ + ImportProductSetsResponse.create = function create(properties) { + return new ImportProductSetsResponse(properties); + }; + + /** + * Encodes the specified ImportProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1.IImportProductSetsResponse} message ImportProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceImages != null && message.referenceImages.length) + for (var i = 0; i < message.referenceImages.length; ++i) + $root.google.cloud.vision.v1.ReferenceImage.encode(message.referenceImages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.statuses != null && message.statuses.length) + for (var i = 0; i < message.statuses.length; ++i) + $root.google.rpc.Status.encode(message.statuses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ImportProductSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1.IImportProductSetsResponse} message ImportProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ImportProductSetsResponse} ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsResponse.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.vision.v1.ImportProductSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.referenceImages && message.referenceImages.length)) + message.referenceImages = []; + message.referenceImages.push($root.google.cloud.vision.v1.ReferenceImage.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.statuses && message.statuses.length)) + message.statuses = []; + message.statuses.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ImportProductSetsResponse} ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsResponse message. + * @function verify + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceImages != null && message.hasOwnProperty("referenceImages")) { + if (!Array.isArray(message.referenceImages)) + return "referenceImages: array expected"; + for (var i = 0; i < message.referenceImages.length; ++i) { + var error = $root.google.cloud.vision.v1.ReferenceImage.verify(message.referenceImages[i]); + if (error) + return "referenceImages." + error; + } + } + if (message.statuses != null && message.hasOwnProperty("statuses")) { + if (!Array.isArray(message.statuses)) + return "statuses: array expected"; + for (var i = 0; i < message.statuses.length; ++i) { + var error = $root.google.rpc.Status.verify(message.statuses[i]); + if (error) + return "statuses." + error; + } + } + return null; + }; + + /** + * Creates an ImportProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ImportProductSetsResponse} ImportProductSetsResponse + */ + ImportProductSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ImportProductSetsResponse) + return object; + var message = new $root.google.cloud.vision.v1.ImportProductSetsResponse(); + if (object.referenceImages) { + if (!Array.isArray(object.referenceImages)) + throw TypeError(".google.cloud.vision.v1.ImportProductSetsResponse.referenceImages: array expected"); + message.referenceImages = []; + for (var i = 0; i < object.referenceImages.length; ++i) { + if (typeof object.referenceImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ImportProductSetsResponse.referenceImages: object expected"); + message.referenceImages[i] = $root.google.cloud.vision.v1.ReferenceImage.fromObject(object.referenceImages[i]); + } + } + if (object.statuses) { + if (!Array.isArray(object.statuses)) + throw TypeError(".google.cloud.vision.v1.ImportProductSetsResponse.statuses: array expected"); + message.statuses = []; + for (var i = 0; i < object.statuses.length; ++i) { + if (typeof object.statuses[i] !== "object") + throw TypeError(".google.cloud.vision.v1.ImportProductSetsResponse.statuses: object expected"); + message.statuses[i] = $root.google.rpc.Status.fromObject(object.statuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1.ImportProductSetsResponse} message ImportProductSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.referenceImages = []; + object.statuses = []; + } + if (message.referenceImages && message.referenceImages.length) { + object.referenceImages = []; + for (var j = 0; j < message.referenceImages.length; ++j) + object.referenceImages[j] = $root.google.cloud.vision.v1.ReferenceImage.toObject(message.referenceImages[j], options); + } + if (message.statuses && message.statuses.length) { + object.statuses = []; + for (var j = 0; j < message.statuses.length; ++j) + object.statuses[j] = $root.google.rpc.Status.toObject(message.statuses[j], options); + } + return object; + }; + + /** + * Converts this ImportProductSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ImportProductSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsResponse; + })(); + + v1.BatchOperationMetadata = (function() { + + /** + * Properties of a BatchOperationMetadata. + * @memberof google.cloud.vision.v1 + * @interface IBatchOperationMetadata + * @property {google.cloud.vision.v1.BatchOperationMetadata.State|null} [state] BatchOperationMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchOperationMetadata submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchOperationMetadata endTime + */ + + /** + * Constructs a new BatchOperationMetadata. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a BatchOperationMetadata. + * @implements IBatchOperationMetadata + * @constructor + * @param {google.cloud.vision.v1.IBatchOperationMetadata=} [properties] Properties to set + */ + function BatchOperationMetadata(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]]; + } + + /** + * BatchOperationMetadata state. + * @member {google.cloud.vision.v1.BatchOperationMetadata.State} state + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.state = 0; + + /** + * BatchOperationMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.submitTime = null; + + /** + * BatchOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.endTime = null; + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1.IBatchOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vision.v1.BatchOperationMetadata} BatchOperationMetadata instance + */ + BatchOperationMetadata.create = function create(properties) { + return new BatchOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.vision.v1.BatchOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1.BatchOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.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.vision.v1.BatchOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOperationMetadata message. + * @function verify + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.BatchOperationMetadata} BatchOperationMetadata + */ + BatchOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.BatchOperationMetadata) + return object; + var message = new $root.google.cloud.vision.v1.BatchOperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PROCESSING": + case 1: + message.state = 1; + break; + case "SUCCESSFUL": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.vision.v1.BatchOperationMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.vision.v1.BatchOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1.BatchOperationMetadata} message BatchOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vision.v1.BatchOperationMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.BatchOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.vision.v1.BatchOperationMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROCESSING=1 PROCESSING value + * @property {number} SUCCESSFUL=2 SUCCESSFUL value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLED=4 CANCELLED value + */ + BatchOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROCESSING"] = 1; + values[valuesById[2] = "SUCCESSFUL"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return BatchOperationMetadata; + })(); + + v1.ProductSetPurgeConfig = (function() { + + /** + * Properties of a ProductSetPurgeConfig. + * @memberof google.cloud.vision.v1 + * @interface IProductSetPurgeConfig + * @property {string|null} [productSetId] ProductSetPurgeConfig productSetId + */ + + /** + * Constructs a new ProductSetPurgeConfig. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a ProductSetPurgeConfig. + * @implements IProductSetPurgeConfig + * @constructor + * @param {google.cloud.vision.v1.IProductSetPurgeConfig=} [properties] Properties to set + */ + function ProductSetPurgeConfig(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]]; + } + + /** + * ProductSetPurgeConfig productSetId. + * @member {string} productSetId + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @instance + */ + ProductSetPurgeConfig.prototype.productSetId = ""; + + /** + * Creates a new ProductSetPurgeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {google.cloud.vision.v1.IProductSetPurgeConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1.ProductSetPurgeConfig} ProductSetPurgeConfig instance + */ + ProductSetPurgeConfig.create = function create(properties) { + return new ProductSetPurgeConfig(properties); + }; + + /** + * Encodes the specified ProductSetPurgeConfig message. Does not implicitly {@link google.cloud.vision.v1.ProductSetPurgeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {google.cloud.vision.v1.IProductSetPurgeConfig} message ProductSetPurgeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSetPurgeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.productSetId); + return writer; + }; + + /** + * Encodes the specified ProductSetPurgeConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1.ProductSetPurgeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {google.cloud.vision.v1.IProductSetPurgeConfig} message ProductSetPurgeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSetPurgeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSetPurgeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.ProductSetPurgeConfig} ProductSetPurgeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSetPurgeConfig.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.vision.v1.ProductSetPurgeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productSetId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSetPurgeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.ProductSetPurgeConfig} ProductSetPurgeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSetPurgeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSetPurgeConfig message. + * @function verify + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSetPurgeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + if (!$util.isString(message.productSetId)) + return "productSetId: string expected"; + return null; + }; + + /** + * Creates a ProductSetPurgeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.ProductSetPurgeConfig} ProductSetPurgeConfig + */ + ProductSetPurgeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.ProductSetPurgeConfig) + return object; + var message = new $root.google.cloud.vision.v1.ProductSetPurgeConfig(); + if (object.productSetId != null) + message.productSetId = String(object.productSetId); + return message; + }; + + /** + * Creates a plain object from a ProductSetPurgeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @static + * @param {google.cloud.vision.v1.ProductSetPurgeConfig} message ProductSetPurgeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSetPurgeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.productSetId = ""; + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + object.productSetId = message.productSetId; + return object; + }; + + /** + * Converts this ProductSetPurgeConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.ProductSetPurgeConfig + * @instance + * @returns {Object.} JSON object + */ + ProductSetPurgeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSetPurgeConfig; + })(); + + v1.PurgeProductsRequest = (function() { + + /** + * Properties of a PurgeProductsRequest. + * @memberof google.cloud.vision.v1 + * @interface IPurgeProductsRequest + * @property {google.cloud.vision.v1.IProductSetPurgeConfig|null} [productSetPurgeConfig] PurgeProductsRequest productSetPurgeConfig + * @property {boolean|null} [deleteOrphanProducts] PurgeProductsRequest deleteOrphanProducts + * @property {string|null} [parent] PurgeProductsRequest parent + * @property {boolean|null} [force] PurgeProductsRequest force + */ + + /** + * Constructs a new PurgeProductsRequest. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a PurgeProductsRequest. + * @implements IPurgeProductsRequest + * @constructor + * @param {google.cloud.vision.v1.IPurgeProductsRequest=} [properties] Properties to set + */ + function PurgeProductsRequest(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]]; + } + + /** + * PurgeProductsRequest productSetPurgeConfig. + * @member {google.cloud.vision.v1.IProductSetPurgeConfig|null|undefined} productSetPurgeConfig + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @instance + */ + PurgeProductsRequest.prototype.productSetPurgeConfig = null; + + /** + * PurgeProductsRequest deleteOrphanProducts. + * @member {boolean} deleteOrphanProducts + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @instance + */ + PurgeProductsRequest.prototype.deleteOrphanProducts = false; + + /** + * PurgeProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @instance + */ + PurgeProductsRequest.prototype.parent = ""; + + /** + * PurgeProductsRequest force. + * @member {boolean} force + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @instance + */ + PurgeProductsRequest.prototype.force = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PurgeProductsRequest target. + * @member {"productSetPurgeConfig"|"deleteOrphanProducts"|undefined} target + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @instance + */ + Object.defineProperty(PurgeProductsRequest.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["productSetPurgeConfig", "deleteOrphanProducts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PurgeProductsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {google.cloud.vision.v1.IPurgeProductsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1.PurgeProductsRequest} PurgeProductsRequest instance + */ + PurgeProductsRequest.create = function create(properties) { + return new PurgeProductsRequest(properties); + }; + + /** + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.vision.v1.PurgeProductsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {google.cloud.vision.v1.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsRequest.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.productSetPurgeConfig != null && message.hasOwnProperty("productSetPurgeConfig")) + $root.google.cloud.vision.v1.ProductSetPurgeConfig.encode(message.productSetPurgeConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deleteOrphanProducts != null && message.hasOwnProperty("deleteOrphanProducts")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteOrphanProducts); + if (message.force != null && message.hasOwnProperty("force")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force); + return writer; + }; + + /** + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1.PurgeProductsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {google.cloud.vision.v1.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.PurgeProductsRequest} PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsRequest.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.vision.v1.PurgeProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.productSetPurgeConfig = $root.google.cloud.vision.v1.ProductSetPurgeConfig.decode(reader, reader.uint32()); + break; + case 3: + message.deleteOrphanProducts = reader.bool(); + break; + case 1: + message.parent = reader.string(); + break; + case 4: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.PurgeProductsRequest} PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeProductsRequest message. + * @function verify + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeProductsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.productSetPurgeConfig != null && message.hasOwnProperty("productSetPurgeConfig")) { + properties.target = 1; + { + var error = $root.google.cloud.vision.v1.ProductSetPurgeConfig.verify(message.productSetPurgeConfig); + if (error) + return "productSetPurgeConfig." + error; + } + } + if (message.deleteOrphanProducts != null && message.hasOwnProperty("deleteOrphanProducts")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + if (typeof message.deleteOrphanProducts !== "boolean") + return "deleteOrphanProducts: boolean expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.PurgeProductsRequest} PurgeProductsRequest + */ + PurgeProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.PurgeProductsRequest) + return object; + var message = new $root.google.cloud.vision.v1.PurgeProductsRequest(); + if (object.productSetPurgeConfig != null) { + if (typeof object.productSetPurgeConfig !== "object") + throw TypeError(".google.cloud.vision.v1.PurgeProductsRequest.productSetPurgeConfig: object expected"); + message.productSetPurgeConfig = $root.google.cloud.vision.v1.ProductSetPurgeConfig.fromObject(object.productSetPurgeConfig); + } + if (object.deleteOrphanProducts != null) + message.deleteOrphanProducts = Boolean(object.deleteOrphanProducts); + if (object.parent != null) + message.parent = String(object.parent); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @static + * @param {google.cloud.vision.v1.PurgeProductsRequest} message PurgeProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.productSetPurgeConfig != null && message.hasOwnProperty("productSetPurgeConfig")) { + object.productSetPurgeConfig = $root.google.cloud.vision.v1.ProductSetPurgeConfig.toObject(message.productSetPurgeConfig, options); + if (options.oneofs) + object.target = "productSetPurgeConfig"; + } + if (message.deleteOrphanProducts != null && message.hasOwnProperty("deleteOrphanProducts")) { + object.deleteOrphanProducts = message.deleteOrphanProducts; + if (options.oneofs) + object.target = "deleteOrphanProducts"; + } + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this PurgeProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.PurgeProductsRequest + * @instance + * @returns {Object.} JSON object + */ + PurgeProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PurgeProductsRequest; + })(); + + v1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.vision.v1 + * @interface ITextAnnotation + * @property {Array.|null} [pages] TextAnnotation pages + * @property {string|null} [text] TextAnnotation text + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.vision.v1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.pages = []; + 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]]; + } + + /** + * TextAnnotation pages. + * @member {Array.} pages + * @memberof google.cloud.vision.v1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.pages = $util.emptyArray; + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.vision.v1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {google.cloud.vision.v1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {google.cloud.vision.v1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.vision.v1.Page.encode(message.pages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {google.cloud.vision.v1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.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.vision.v1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.vision.v1.Page.decode(reader, reader.uint32())); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.vision.v1.Page.verify(message.pages[i]); + if (error) + return "pages." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.TextAnnotation) + return object; + var message = new $root.google.cloud.vision.v1.TextAnnotation(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.vision.v1.TextAnnotation.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.TextAnnotation.pages: object expected"); + message.pages[i] = $root.google.cloud.vision.v1.Page.fromObject(object.pages[i]); + } + } + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.TextAnnotation + * @static + * @param {google.cloud.vision.v1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (options.defaults) + object.text = ""; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.vision.v1.Page.toObject(message.pages[j], options); + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TextAnnotation.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.vision.v1.TextAnnotation + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.vision.v1.TextAnnotation + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(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]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.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.vision.v1.TextAnnotation.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.TextAnnotation.DetectedLanguage) + return object; + var message = new $root.google.cloud.vision.v1.TextAnnotation.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1.TextAnnotation.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectedLanguage; + })(); + + TextAnnotation.DetectedBreak = (function() { + + /** + * Properties of a DetectedBreak. + * @memberof google.cloud.vision.v1.TextAnnotation + * @interface IDetectedBreak + * @property {google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType|null} [type] DetectedBreak type + * @property {boolean|null} [isPrefix] DetectedBreak isPrefix + */ + + /** + * Constructs a new DetectedBreak. + * @memberof google.cloud.vision.v1.TextAnnotation + * @classdesc Represents a DetectedBreak. + * @implements IDetectedBreak + * @constructor + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + */ + function DetectedBreak(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]]; + } + + /** + * DetectedBreak type. + * @member {google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType} type + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.type = 0; + + /** + * DetectedBreak isPrefix. + * @member {boolean} isPrefix + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.isPrefix = false; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedBreak} DetectedBreak instance + */ + DetectedBreak.create = function create(properties) { + return new DetectedBreak(properties); + }; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isPrefix); + return writer; + }; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.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.vision.v1.TextAnnotation.DetectedBreak(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.isPrefix = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedBreak message. + * @function verify + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedBreak.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + if (typeof message.isPrefix !== "boolean") + return "isPrefix: boolean expected"; + return null; + }; + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.TextAnnotation.DetectedBreak} DetectedBreak + */ + DetectedBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak) + return object; + var message = new $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "SPACE": + case 1: + message.type = 1; + break; + case "SURE_SPACE": + case 2: + message.type = 2; + break; + case "EOL_SURE_SPACE": + case 3: + message.type = 3; + break; + case "HYPHEN": + case 4: + message.type = 4; + break; + case "LINE_BREAK": + case 5: + message.type = 5; + break; + } + if (object.isPrefix != null) + message.isPrefix = Boolean(object.isPrefix); + return message; + }; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1.TextAnnotation.DetectedBreak} message DetectedBreak + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedBreak.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.isPrefix = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType[message.type] : message.type; + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + object.isPrefix = message.isPrefix; + return object; + }; + + /** + * Converts this DetectedBreak to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.TextAnnotation.DetectedBreak + * @instance + * @returns {Object.} JSON object + */ + DetectedBreak.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BreakType enum. + * @name google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SPACE=1 SPACE value + * @property {number} SURE_SPACE=2 SURE_SPACE value + * @property {number} EOL_SURE_SPACE=3 EOL_SURE_SPACE value + * @property {number} HYPHEN=4 HYPHEN value + * @property {number} LINE_BREAK=5 LINE_BREAK value + */ + DetectedBreak.BreakType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SPACE"] = 1; + values[valuesById[2] = "SURE_SPACE"] = 2; + values[valuesById[3] = "EOL_SURE_SPACE"] = 3; + values[valuesById[4] = "HYPHEN"] = 4; + values[valuesById[5] = "LINE_BREAK"] = 5; + return values; + })(); + + return DetectedBreak; + })(); + + TextAnnotation.TextProperty = (function() { + + /** + * Properties of a TextProperty. + * @memberof google.cloud.vision.v1.TextAnnotation + * @interface ITextProperty + * @property {Array.|null} [detectedLanguages] TextProperty detectedLanguages + * @property {google.cloud.vision.v1.TextAnnotation.IDetectedBreak|null} [detectedBreak] TextProperty detectedBreak + */ + + /** + * Constructs a new TextProperty. + * @memberof google.cloud.vision.v1.TextAnnotation + * @classdesc Represents a TextProperty. + * @implements ITextProperty + * @constructor + * @param {google.cloud.vision.v1.TextAnnotation.ITextProperty=} [properties] Properties to set + */ + function TextProperty(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * TextProperty detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedLanguages = $util.emptyArray; + + /** + * TextProperty detectedBreak. + * @member {google.cloud.vision.v1.TextAnnotation.IDetectedBreak|null|undefined} detectedBreak + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedBreak = null; + + /** + * Creates a new TextProperty instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1.TextAnnotation.ITextProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1.TextAnnotation.TextProperty} TextProperty instance + */ + TextProperty.create = function create(properties) { + return new TextProperty(properties); + }; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.vision.v1.TextAnnotation.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak.encode(message.detectedBreak, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.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.vision.v1.TextAnnotation.TextProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.vision.v1.TextAnnotation.DetectedLanguage.decode(reader, reader.uint32())); + break; + case 2: + message.detectedBreak = $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProperty message. + * @function verify + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.vision.v1.TextAnnotation.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { + var error = $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak.verify(message.detectedBreak); + if (error) + return "detectedBreak." + error; + } + return null; + }; + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.TextAnnotation.TextProperty} TextProperty + */ + TextProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.TextAnnotation.TextProperty) + return object; + var message = new $root.google.cloud.vision.v1.TextAnnotation.TextProperty(); + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.vision.v1.TextAnnotation.TextProperty.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.TextAnnotation.TextProperty.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.vision.v1.TextAnnotation.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.detectedBreak != null) { + if (typeof object.detectedBreak !== "object") + throw TypeError(".google.cloud.vision.v1.TextAnnotation.TextProperty.detectedBreak: object expected"); + message.detectedBreak = $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak.fromObject(object.detectedBreak); + } + return message; + }; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1.TextAnnotation.TextProperty} message TextProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) + object.detectedBreak = null; + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.vision.v1.TextAnnotation.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + object.detectedBreak = $root.google.cloud.vision.v1.TextAnnotation.DetectedBreak.toObject(message.detectedBreak, options); + return object; + }; + + /** + * Converts this TextProperty to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.TextAnnotation.TextProperty + * @instance + * @returns {Object.} JSON object + */ + TextProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProperty; + })(); + + return TextAnnotation; + })(); + + v1.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.vision.v1 + * @interface IPage + * @property {google.cloud.vision.v1.TextAnnotation.ITextProperty|null} [property] Page property + * @property {number|null} [width] Page width + * @property {number|null} [height] Page height + * @property {Array.|null} [blocks] Page blocks + * @property {number|null} [confidence] Page confidence + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.vision.v1.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.blocks = []; + 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]]; + } + + /** + * Page property. + * @member {google.cloud.vision.v1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1.Page + * @instance + */ + Page.prototype.property = null; + + /** + * Page width. + * @member {number} width + * @memberof google.cloud.vision.v1.Page + * @instance + */ + Page.prototype.width = 0; + + /** + * Page height. + * @member {number} height + * @memberof google.cloud.vision.v1.Page + * @instance + */ + Page.prototype.height = 0; + + /** + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.vision.v1.Page + * @instance + */ + Page.prototype.blocks = $util.emptyArray; + + /** + * Page confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.Page + * @instance + */ + Page.prototype.confidence = 0; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Page + * @static + * @param {google.cloud.vision.v1.IPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Page + * @static + * @param {google.cloud.vision.v1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.width != null && message.hasOwnProperty("width")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.width); + if (message.height != null && message.hasOwnProperty("height")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.height); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.vision.v1.Block.encode(message.blocks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Page + * @static + * @param {google.cloud.vision.v1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.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.vision.v1.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.width = reader.int32(); + break; + case 3: + message.height = reader.int32(); + break; + case 4: + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.vision.v1.Block.decode(reader, reader.uint32())); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.vision.v1.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.vision.v1.Block.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Page) + return object; + var message = new $root.google.cloud.vision.v1.Page(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1.Page.property: object expected"); + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.vision.v1.Page.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.vision.v1.Page.blocks: object expected"); + message.blocks[i] = $root.google.cloud.vision.v1.Block.fromObject(object.blocks[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Page + * @static + * @param {google.cloud.vision.v1.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (options.defaults) { + object.property = null; + object.width = 0; + object.height = 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.vision.v1.Block.toObject(message.blocks[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Page; + })(); + + v1.Block = (function() { + + /** + * Properties of a Block. + * @memberof google.cloud.vision.v1 + * @interface IBlock + * @property {google.cloud.vision.v1.TextAnnotation.ITextProperty|null} [property] Block property + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingBox] Block boundingBox + * @property {Array.|null} [paragraphs] Block paragraphs + * @property {google.cloud.vision.v1.Block.BlockType|null} [blockType] Block blockType + * @property {number|null} [confidence] Block confidence + */ + + /** + * Constructs a new Block. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {google.cloud.vision.v1.IBlock=} [properties] Properties to set + */ + function Block(properties) { + this.paragraphs = []; + 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]]; + } + + /** + * Block property. + * @member {google.cloud.vision.v1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1.Block + * @instance + */ + Block.prototype.property = null; + + /** + * Block boundingBox. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1.Block + * @instance + */ + Block.prototype.boundingBox = null; + + /** + * Block paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.vision.v1.Block + * @instance + */ + Block.prototype.paragraphs = $util.emptyArray; + + /** + * Block blockType. + * @member {google.cloud.vision.v1.Block.BlockType} blockType + * @memberof google.cloud.vision.v1.Block + * @instance + */ + Block.prototype.blockType = 0; + + /** + * Block confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.Block + * @instance + */ + Block.prototype.confidence = 0; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Block + * @static + * @param {google.cloud.vision.v1.IBlock=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1.Block.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Block + * @static + * @param {google.cloud.vision.v1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paragraphs != null && message.paragraphs.length) + for (var i = 0; i < message.paragraphs.length; ++i) + $root.google.cloud.vision.v1.Paragraph.encode(message.paragraphs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.blockType != null && message.hasOwnProperty("blockType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.blockType); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Block + * @static + * @param {google.cloud.vision.v1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.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.vision.v1.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.paragraphs && message.paragraphs.length)) + message.paragraphs = []; + message.paragraphs.push($root.google.cloud.vision.v1.Paragraph.decode(reader, reader.uint32())); + break; + case 4: + message.blockType = reader.int32(); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof google.cloud.vision.v1.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.paragraphs != null && message.hasOwnProperty("paragraphs")) { + if (!Array.isArray(message.paragraphs)) + return "paragraphs: array expected"; + for (var i = 0; i < message.paragraphs.length; ++i) { + var error = $root.google.cloud.vision.v1.Paragraph.verify(message.paragraphs[i]); + if (error) + return "paragraphs." + error; + } + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + switch (message.blockType) { + default: + return "blockType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Block + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Block) + return object; + var message = new $root.google.cloud.vision.v1.Block(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1.Block.property: object expected"); + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1.Block.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.paragraphs) { + if (!Array.isArray(object.paragraphs)) + throw TypeError(".google.cloud.vision.v1.Block.paragraphs: array expected"); + message.paragraphs = []; + for (var i = 0; i < object.paragraphs.length; ++i) { + if (typeof object.paragraphs[i] !== "object") + throw TypeError(".google.cloud.vision.v1.Block.paragraphs: object expected"); + message.paragraphs[i] = $root.google.cloud.vision.v1.Paragraph.fromObject(object.paragraphs[i]); + } + } + switch (object.blockType) { + case "UNKNOWN": + case 0: + message.blockType = 0; + break; + case "TEXT": + case 1: + message.blockType = 1; + break; + case "TABLE": + case 2: + message.blockType = 2; + break; + case "PICTURE": + case 3: + message.blockType = 3; + break; + case "RULER": + case 4: + message.blockType = 4; + break; + case "BARCODE": + case 5: + message.blockType = 5; + break; + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Block + * @static + * @param {google.cloud.vision.v1.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paragraphs = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.blockType = options.enums === String ? "UNKNOWN" : 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingBox, options); + if (message.paragraphs && message.paragraphs.length) { + object.paragraphs = []; + for (var j = 0; j < message.paragraphs.length; ++j) + object.paragraphs[j] = $root.google.cloud.vision.v1.Paragraph.toObject(message.paragraphs[j], options); + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + object.blockType = options.enums === String ? $root.google.cloud.vision.v1.Block.BlockType[message.blockType] : message.blockType; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BlockType enum. + * @name google.cloud.vision.v1.Block.BlockType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} TEXT=1 TEXT value + * @property {number} TABLE=2 TABLE value + * @property {number} PICTURE=3 PICTURE value + * @property {number} RULER=4 RULER value + * @property {number} BARCODE=5 BARCODE value + */ + Block.BlockType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "TABLE"] = 2; + values[valuesById[3] = "PICTURE"] = 3; + values[valuesById[4] = "RULER"] = 4; + values[valuesById[5] = "BARCODE"] = 5; + return values; + })(); + + return Block; + })(); + + v1.Paragraph = (function() { + + /** + * Properties of a Paragraph. + * @memberof google.cloud.vision.v1 + * @interface IParagraph + * @property {google.cloud.vision.v1.TextAnnotation.ITextProperty|null} [property] Paragraph property + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingBox] Paragraph boundingBox + * @property {Array.|null} [words] Paragraph words + * @property {number|null} [confidence] Paragraph confidence + */ + + /** + * Constructs a new Paragraph. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Paragraph. + * @implements IParagraph + * @constructor + * @param {google.cloud.vision.v1.IParagraph=} [properties] Properties to set + */ + function Paragraph(properties) { + this.words = []; + 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]]; + } + + /** + * Paragraph property. + * @member {google.cloud.vision.v1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1.Paragraph + * @instance + */ + Paragraph.prototype.property = null; + + /** + * Paragraph boundingBox. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1.Paragraph + * @instance + */ + Paragraph.prototype.boundingBox = null; + + /** + * Paragraph words. + * @member {Array.} words + * @memberof google.cloud.vision.v1.Paragraph + * @instance + */ + Paragraph.prototype.words = $util.emptyArray; + + /** + * Paragraph confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.Paragraph + * @instance + */ + Paragraph.prototype.confidence = 0; + + /** + * Creates a new Paragraph instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {google.cloud.vision.v1.IParagraph=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Paragraph} Paragraph instance + */ + Paragraph.create = function create(properties) { + return new Paragraph(properties); + }; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1.Paragraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {google.cloud.vision.v1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.vision.v1.Word.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Paragraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {google.cloud.vision.v1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.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.vision.v1.Paragraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.vision.v1.Word.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Paragraph message. + * @function verify + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Paragraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.vision.v1.Word.verify(message.words[i]); + if (error) + return "words." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Paragraph} Paragraph + */ + Paragraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Paragraph) + return object; + var message = new $root.google.cloud.vision.v1.Paragraph(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1.Paragraph.property: object expected"); + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1.Paragraph.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.vision.v1.Paragraph.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.vision.v1.Paragraph.words: object expected"); + message.words[i] = $root.google.cloud.vision.v1.Word.fromObject(object.words[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Paragraph + * @static + * @param {google.cloud.vision.v1.Paragraph} message Paragraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Paragraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingBox, options); + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.vision.v1.Word.toObject(message.words[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Paragraph to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Paragraph + * @instance + * @returns {Object.} JSON object + */ + Paragraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Paragraph; + })(); + + v1.Word = (function() { + + /** + * Properties of a Word. + * @memberof google.cloud.vision.v1 + * @interface IWord + * @property {google.cloud.vision.v1.TextAnnotation.ITextProperty|null} [property] Word property + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingBox] Word boundingBox + * @property {Array.|null} [symbols] Word symbols + * @property {number|null} [confidence] Word confidence + */ + + /** + * Constructs a new Word. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Word. + * @implements IWord + * @constructor + * @param {google.cloud.vision.v1.IWord=} [properties] Properties to set + */ + function Word(properties) { + this.symbols = []; + 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]]; + } + + /** + * Word property. + * @member {google.cloud.vision.v1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1.Word + * @instance + */ + Word.prototype.property = null; + + /** + * Word boundingBox. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1.Word + * @instance + */ + Word.prototype.boundingBox = null; + + /** + * Word symbols. + * @member {Array.} symbols + * @memberof google.cloud.vision.v1.Word + * @instance + */ + Word.prototype.symbols = $util.emptyArray; + + /** + * Word confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.Word + * @instance + */ + Word.prototype.confidence = 0; + + /** + * Creates a new Word instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Word + * @static + * @param {google.cloud.vision.v1.IWord=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Word} Word instance + */ + Word.create = function create(properties) { + return new Word(properties); + }; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1.Word.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Word + * @static + * @param {google.cloud.vision.v1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.symbols != null && message.symbols.length) + for (var i = 0; i < message.symbols.length; ++i) + $root.google.cloud.vision.v1.Symbol.encode(message.symbols[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Word.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Word + * @static + * @param {google.cloud.vision.v1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Word message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.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.vision.v1.Word(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.symbols && message.symbols.length)) + message.symbols = []; + message.symbols.push($root.google.cloud.vision.v1.Symbol.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Word message. + * @function verify + * @memberof google.cloud.vision.v1.Word + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Word.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.symbols != null && message.hasOwnProperty("symbols")) { + if (!Array.isArray(message.symbols)) + return "symbols: array expected"; + for (var i = 0; i < message.symbols.length; ++i) { + var error = $root.google.cloud.vision.v1.Symbol.verify(message.symbols[i]); + if (error) + return "symbols." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Word + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Word} Word + */ + Word.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Word) + return object; + var message = new $root.google.cloud.vision.v1.Word(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1.Word.property: object expected"); + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1.Word.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.symbols) { + if (!Array.isArray(object.symbols)) + throw TypeError(".google.cloud.vision.v1.Word.symbols: array expected"); + message.symbols = []; + for (var i = 0; i < object.symbols.length; ++i) { + if (typeof object.symbols[i] !== "object") + throw TypeError(".google.cloud.vision.v1.Word.symbols: object expected"); + message.symbols[i] = $root.google.cloud.vision.v1.Symbol.fromObject(object.symbols[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Word + * @static + * @param {google.cloud.vision.v1.Word} message Word + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Word.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.symbols = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingBox, options); + if (message.symbols && message.symbols.length) { + object.symbols = []; + for (var j = 0; j < message.symbols.length; ++j) + object.symbols[j] = $root.google.cloud.vision.v1.Symbol.toObject(message.symbols[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Word to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Word + * @instance + * @returns {Object.} JSON object + */ + Word.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Word; + })(); + + v1.Symbol = (function() { + + /** + * Properties of a Symbol. + * @memberof google.cloud.vision.v1 + * @interface ISymbol + * @property {google.cloud.vision.v1.TextAnnotation.ITextProperty|null} [property] Symbol property + * @property {google.cloud.vision.v1.IBoundingPoly|null} [boundingBox] Symbol boundingBox + * @property {string|null} [text] Symbol text + * @property {number|null} [confidence] Symbol confidence + */ + + /** + * Constructs a new Symbol. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a Symbol. + * @implements ISymbol + * @constructor + * @param {google.cloud.vision.v1.ISymbol=} [properties] Properties to set + */ + function Symbol(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]]; + } + + /** + * Symbol property. + * @member {google.cloud.vision.v1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1.Symbol + * @instance + */ + Symbol.prototype.property = null; + + /** + * Symbol boundingBox. + * @member {google.cloud.vision.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1.Symbol + * @instance + */ + Symbol.prototype.boundingBox = null; + + /** + * Symbol text. + * @member {string} text + * @memberof google.cloud.vision.v1.Symbol + * @instance + */ + Symbol.prototype.text = ""; + + /** + * Symbol confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1.Symbol + * @instance + */ + Symbol.prototype.confidence = 0; + + /** + * Creates a new Symbol instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {google.cloud.vision.v1.ISymbol=} [properties] Properties to set + * @returns {google.cloud.vision.v1.Symbol} Symbol instance + */ + Symbol.create = function create(properties) { + return new Symbol(properties); + }; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1.Symbol.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {google.cloud.vision.v1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1.Symbol.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {google.cloud.vision.v1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.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.vision.v1.Symbol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + message.text = reader.string(); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Symbol message. + * @function verify + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Symbol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.Symbol} Symbol + */ + Symbol.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.Symbol) + return object; + var message = new $root.google.cloud.vision.v1.Symbol(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1.Symbol.property: object expected"); + message.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1.Symbol.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.text != null) + message.text = String(object.text); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.Symbol + * @static + * @param {google.cloud.vision.v1.Symbol} message Symbol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Symbol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.text = ""; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1.BoundingPoly.toObject(message.boundingBox, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Symbol to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.Symbol + * @instance + * @returns {Object.} JSON object + */ + Symbol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Symbol; + })(); + + v1.WebDetection = (function() { + + /** + * Properties of a WebDetection. + * @memberof google.cloud.vision.v1 + * @interface IWebDetection + * @property {Array.|null} [webEntities] WebDetection webEntities + * @property {Array.|null} [fullMatchingImages] WebDetection fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebDetection partialMatchingImages + * @property {Array.|null} [pagesWithMatchingImages] WebDetection pagesWithMatchingImages + * @property {Array.|null} [visuallySimilarImages] WebDetection visuallySimilarImages + * @property {Array.|null} [bestGuessLabels] WebDetection bestGuessLabels + */ + + /** + * Constructs a new WebDetection. + * @memberof google.cloud.vision.v1 + * @classdesc Represents a WebDetection. + * @implements IWebDetection + * @constructor + * @param {google.cloud.vision.v1.IWebDetection=} [properties] Properties to set + */ + function WebDetection(properties) { + this.webEntities = []; + this.fullMatchingImages = []; + this.partialMatchingImages = []; + this.pagesWithMatchingImages = []; + this.visuallySimilarImages = []; + this.bestGuessLabels = []; + 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]]; + } + + /** + * WebDetection webEntities. + * @member {Array.} webEntities + * @memberof google.cloud.vision.v1.WebDetection + * @instance + */ + WebDetection.prototype.webEntities = $util.emptyArray; + + /** + * WebDetection fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1.WebDetection + * @instance + */ + WebDetection.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebDetection partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1.WebDetection + * @instance + */ + WebDetection.prototype.partialMatchingImages = $util.emptyArray; + + /** + * WebDetection pagesWithMatchingImages. + * @member {Array.} pagesWithMatchingImages + * @memberof google.cloud.vision.v1.WebDetection + * @instance + */ + WebDetection.prototype.pagesWithMatchingImages = $util.emptyArray; + + /** + * WebDetection visuallySimilarImages. + * @member {Array.} visuallySimilarImages + * @memberof google.cloud.vision.v1.WebDetection + * @instance + */ + WebDetection.prototype.visuallySimilarImages = $util.emptyArray; + + /** + * WebDetection bestGuessLabels. + * @member {Array.} bestGuessLabels + * @memberof google.cloud.vision.v1.WebDetection + * @instance + */ + WebDetection.prototype.bestGuessLabels = $util.emptyArray; + + /** + * Creates a new WebDetection instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {google.cloud.vision.v1.IWebDetection=} [properties] Properties to set + * @returns {google.cloud.vision.v1.WebDetection} WebDetection instance + */ + WebDetection.create = function create(properties) { + return new WebDetection(properties); + }; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {google.cloud.vision.v1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webEntities != null && message.webEntities.length) + for (var i = 0; i < message.webEntities.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebEntity.encode(message.webEntities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pagesWithMatchingImages != null && message.pagesWithMatchingImages.length) + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebPage.encode(message.pagesWithMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.visuallySimilarImages != null && message.visuallySimilarImages.length) + for (var i = 0; i < message.visuallySimilarImages.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebImage.encode(message.visuallySimilarImages[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bestGuessLabels != null && message.bestGuessLabels.length) + for (var i = 0; i < message.bestGuessLabels.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebLabel.encode(message.bestGuessLabels[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {google.cloud.vision.v1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.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.vision.v1.WebDetection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.webEntities && message.webEntities.length)) + message.webEntities = []; + message.webEntities.push($root.google.cloud.vision.v1.WebDetection.WebEntity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.pagesWithMatchingImages && message.pagesWithMatchingImages.length)) + message.pagesWithMatchingImages = []; + message.pagesWithMatchingImages.push($root.google.cloud.vision.v1.WebDetection.WebPage.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.visuallySimilarImages && message.visuallySimilarImages.length)) + message.visuallySimilarImages = []; + message.visuallySimilarImages.push($root.google.cloud.vision.v1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.bestGuessLabels && message.bestGuessLabels.length)) + message.bestGuessLabels = []; + message.bestGuessLabels.push($root.google.cloud.vision.v1.WebDetection.WebLabel.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetection message. + * @function verify + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webEntities != null && message.hasOwnProperty("webEntities")) { + if (!Array.isArray(message.webEntities)) + return "webEntities: array expected"; + for (var i = 0; i < message.webEntities.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebEntity.verify(message.webEntities[i]); + if (error) + return "webEntities." + error; + } + } + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + if (message.pagesWithMatchingImages != null && message.hasOwnProperty("pagesWithMatchingImages")) { + if (!Array.isArray(message.pagesWithMatchingImages)) + return "pagesWithMatchingImages: array expected"; + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebPage.verify(message.pagesWithMatchingImages[i]); + if (error) + return "pagesWithMatchingImages." + error; + } + } + if (message.visuallySimilarImages != null && message.hasOwnProperty("visuallySimilarImages")) { + if (!Array.isArray(message.visuallySimilarImages)) + return "visuallySimilarImages: array expected"; + for (var i = 0; i < message.visuallySimilarImages.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebImage.verify(message.visuallySimilarImages[i]); + if (error) + return "visuallySimilarImages." + error; + } + } + if (message.bestGuessLabels != null && message.hasOwnProperty("bestGuessLabels")) { + if (!Array.isArray(message.bestGuessLabels)) + return "bestGuessLabels: array expected"; + for (var i = 0; i < message.bestGuessLabels.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebLabel.verify(message.bestGuessLabels[i]); + if (error) + return "bestGuessLabels." + error; + } + } + return null; + }; + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.WebDetection} WebDetection + */ + WebDetection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.WebDetection) + return object; + var message = new $root.google.cloud.vision.v1.WebDetection(); + if (object.webEntities) { + if (!Array.isArray(object.webEntities)) + throw TypeError(".google.cloud.vision.v1.WebDetection.webEntities: array expected"); + message.webEntities = []; + for (var i = 0; i < object.webEntities.length; ++i) { + if (typeof object.webEntities[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.webEntities: object expected"); + message.webEntities[i] = $root.google.cloud.vision.v1.WebDetection.WebEntity.fromObject(object.webEntities[i]); + } + } + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1.WebDetection.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1.WebDetection.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + if (object.pagesWithMatchingImages) { + if (!Array.isArray(object.pagesWithMatchingImages)) + throw TypeError(".google.cloud.vision.v1.WebDetection.pagesWithMatchingImages: array expected"); + message.pagesWithMatchingImages = []; + for (var i = 0; i < object.pagesWithMatchingImages.length; ++i) { + if (typeof object.pagesWithMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.pagesWithMatchingImages: object expected"); + message.pagesWithMatchingImages[i] = $root.google.cloud.vision.v1.WebDetection.WebPage.fromObject(object.pagesWithMatchingImages[i]); + } + } + if (object.visuallySimilarImages) { + if (!Array.isArray(object.visuallySimilarImages)) + throw TypeError(".google.cloud.vision.v1.WebDetection.visuallySimilarImages: array expected"); + message.visuallySimilarImages = []; + for (var i = 0; i < object.visuallySimilarImages.length; ++i) { + if (typeof object.visuallySimilarImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.visuallySimilarImages: object expected"); + message.visuallySimilarImages[i] = $root.google.cloud.vision.v1.WebDetection.WebImage.fromObject(object.visuallySimilarImages[i]); + } + } + if (object.bestGuessLabels) { + if (!Array.isArray(object.bestGuessLabels)) + throw TypeError(".google.cloud.vision.v1.WebDetection.bestGuessLabels: array expected"); + message.bestGuessLabels = []; + for (var i = 0; i < object.bestGuessLabels.length; ++i) { + if (typeof object.bestGuessLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.bestGuessLabels: object expected"); + message.bestGuessLabels[i] = $root.google.cloud.vision.v1.WebDetection.WebLabel.fromObject(object.bestGuessLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.WebDetection + * @static + * @param {google.cloud.vision.v1.WebDetection} message WebDetection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.webEntities = []; + object.fullMatchingImages = []; + object.partialMatchingImages = []; + object.pagesWithMatchingImages = []; + object.visuallySimilarImages = []; + object.bestGuessLabels = []; + } + if (message.webEntities && message.webEntities.length) { + object.webEntities = []; + for (var j = 0; j < message.webEntities.length; ++j) + object.webEntities[j] = $root.google.cloud.vision.v1.WebDetection.WebEntity.toObject(message.webEntities[j], options); + } + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + if (message.pagesWithMatchingImages && message.pagesWithMatchingImages.length) { + object.pagesWithMatchingImages = []; + for (var j = 0; j < message.pagesWithMatchingImages.length; ++j) + object.pagesWithMatchingImages[j] = $root.google.cloud.vision.v1.WebDetection.WebPage.toObject(message.pagesWithMatchingImages[j], options); + } + if (message.visuallySimilarImages && message.visuallySimilarImages.length) { + object.visuallySimilarImages = []; + for (var j = 0; j < message.visuallySimilarImages.length; ++j) + object.visuallySimilarImages[j] = $root.google.cloud.vision.v1.WebDetection.WebImage.toObject(message.visuallySimilarImages[j], options); + } + if (message.bestGuessLabels && message.bestGuessLabels.length) { + object.bestGuessLabels = []; + for (var j = 0; j < message.bestGuessLabels.length; ++j) + object.bestGuessLabels[j] = $root.google.cloud.vision.v1.WebDetection.WebLabel.toObject(message.bestGuessLabels[j], options); + } + return object; + }; + + /** + * Converts this WebDetection to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.WebDetection + * @instance + * @returns {Object.} JSON object + */ + WebDetection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WebDetection.WebEntity = (function() { + + /** + * Properties of a WebEntity. + * @memberof google.cloud.vision.v1.WebDetection + * @interface IWebEntity + * @property {string|null} [entityId] WebEntity entityId + * @property {number|null} [score] WebEntity score + * @property {string|null} [description] WebEntity description + */ + + /** + * Constructs a new WebEntity. + * @memberof google.cloud.vision.v1.WebDetection + * @classdesc Represents a WebEntity. + * @implements IWebEntity + * @constructor + * @param {google.cloud.vision.v1.WebDetection.IWebEntity=} [properties] Properties to set + */ + function WebEntity(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]]; + } + + /** + * WebEntity entityId. + * @member {string} entityId + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.entityId = ""; + + /** + * WebEntity score. + * @member {number} score + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.score = 0; + + /** + * WebEntity description. + * @member {string} description + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.description = ""; + + /** + * Creates a new WebEntity instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebEntity=} [properties] Properties to set + * @returns {google.cloud.vision.v1.WebDetection.WebEntity} WebEntity instance + */ + WebEntity.create = function create(properties) { + return new WebEntity(properties); + }; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && message.hasOwnProperty("entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.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.vision.v1.WebDetection.WebEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entityId = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebEntity message. + * @function verify + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.WebDetection.WebEntity} WebEntity + */ + WebEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.WebDetection.WebEntity) + return object; + var message = new $root.google.cloud.vision.v1.WebDetection.WebEntity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.score != null) + message.score = Number(object.score); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1.WebDetection.WebEntity} message WebEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.score = 0; + object.description = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this WebEntity to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.WebDetection.WebEntity + * @instance + * @returns {Object.} JSON object + */ + WebEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebEntity; + })(); + + WebDetection.WebImage = (function() { + + /** + * Properties of a WebImage. + * @memberof google.cloud.vision.v1.WebDetection + * @interface IWebImage + * @property {string|null} [url] WebImage url + * @property {number|null} [score] WebImage score + */ + + /** + * Constructs a new WebImage. + * @memberof google.cloud.vision.v1.WebDetection + * @classdesc Represents a WebImage. + * @implements IWebImage + * @constructor + * @param {google.cloud.vision.v1.WebDetection.IWebImage=} [properties] Properties to set + */ + function WebImage(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]]; + } + + /** + * WebImage url. + * @member {string} url + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.url = ""; + + /** + * WebImage score. + * @member {number} score + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.score = 0; + + /** + * Creates a new WebImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1.WebDetection.WebImage} WebImage instance + */ + WebImage.create = function create(properties) { + return new WebImage(properties); + }; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.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.vision.v1.WebDetection.WebImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebImage message. + * @function verify + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebImage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.WebDetection.WebImage} WebImage + */ + WebImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.WebDetection.WebImage) + return object; + var message = new $root.google.cloud.vision.v1.WebDetection.WebImage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1.WebDetection.WebImage} message WebImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.score = 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this WebImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.WebDetection.WebImage + * @instance + * @returns {Object.} JSON object + */ + WebImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebImage; + })(); + + WebDetection.WebPage = (function() { + + /** + * Properties of a WebPage. + * @memberof google.cloud.vision.v1.WebDetection + * @interface IWebPage + * @property {string|null} [url] WebPage url + * @property {number|null} [score] WebPage score + * @property {string|null} [pageTitle] WebPage pageTitle + * @property {Array.|null} [fullMatchingImages] WebPage fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebPage partialMatchingImages + */ + + /** + * Constructs a new WebPage. + * @memberof google.cloud.vision.v1.WebDetection + * @classdesc Represents a WebPage. + * @implements IWebPage + * @constructor + * @param {google.cloud.vision.v1.WebDetection.IWebPage=} [properties] Properties to set + */ + function WebPage(properties) { + this.fullMatchingImages = []; + this.partialMatchingImages = []; + 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]]; + } + + /** + * WebPage url. + * @member {string} url + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.url = ""; + + /** + * WebPage score. + * @member {number} score + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.score = 0; + + /** + * WebPage pageTitle. + * @member {string} pageTitle + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.pageTitle = ""; + + /** + * WebPage fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebPage partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.partialMatchingImages = $util.emptyArray; + + /** + * Creates a new WebPage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1.WebDetection.WebPage} WebPage instance + */ + WebPage.create = function create(properties) { + return new WebPage(properties); + }; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebPage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageTitle); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebPage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.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.vision.v1.WebDetection.WebPage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pageTitle = reader.string(); + break; + case 4: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebPage message. + * @function verify + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebPage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + if (!$util.isString(message.pageTitle)) + return "pageTitle: string expected"; + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + return null; + }; + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.WebDetection.WebPage} WebPage + */ + WebPage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.WebDetection.WebPage) + return object; + var message = new $root.google.cloud.vision.v1.WebDetection.WebPage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + if (object.pageTitle != null) + message.pageTitle = String(object.pageTitle); + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1.WebDetection.WebPage.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.WebPage.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1.WebDetection.WebPage.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1.WebDetection.WebPage.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1.WebDetection.WebPage} message WebPage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebPage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fullMatchingImages = []; + object.partialMatchingImages = []; + } + if (options.defaults) { + object.url = ""; + object.score = 0; + object.pageTitle = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + object.pageTitle = message.pageTitle; + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + return object; + }; + + /** + * Converts this WebPage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.WebDetection.WebPage + * @instance + * @returns {Object.} JSON object + */ + WebPage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebPage; + })(); + + WebDetection.WebLabel = (function() { + + /** + * Properties of a WebLabel. + * @memberof google.cloud.vision.v1.WebDetection + * @interface IWebLabel + * @property {string|null} [label] WebLabel label + * @property {string|null} [languageCode] WebLabel languageCode + */ + + /** + * Constructs a new WebLabel. + * @memberof google.cloud.vision.v1.WebDetection + * @classdesc Represents a WebLabel. + * @implements IWebLabel + * @constructor + * @param {google.cloud.vision.v1.WebDetection.IWebLabel=} [properties] Properties to set + */ + function WebLabel(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]]; + } + + /** + * WebLabel label. + * @member {string} label + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.label = ""; + + /** + * WebLabel languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.languageCode = ""; + + /** + * Creates a new WebLabel instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebLabel=} [properties] Properties to set + * @returns {google.cloud.vision.v1.WebDetection.WebLabel} WebLabel instance + */ + WebLabel.create = function create(properties) { + return new WebLabel(properties); + }; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebLabel.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1.WebDetection.WebLabel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.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.vision.v1.WebDetection.WebLabel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebLabel message. + * @function verify + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebLabel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1.WebDetection.WebLabel} WebLabel + */ + WebLabel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1.WebDetection.WebLabel) + return object; + var message = new $root.google.cloud.vision.v1.WebDetection.WebLabel(); + if (object.label != null) + message.label = String(object.label); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1.WebDetection.WebLabel} message WebLabel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebLabel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.languageCode = ""; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this WebLabel to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1.WebDetection.WebLabel + * @instance + * @returns {Object.} JSON object + */ + WebLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebLabel; + })(); + + return WebDetection; + })(); + + return v1; + })(); + + vision.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.vision + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.ImageAnnotator = (function() { + + /** + * Constructs a new ImageAnnotator service. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an ImageAnnotator + * @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 ImageAnnotator(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ImageAnnotator.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageAnnotator; + + /** + * Creates new ImageAnnotator service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1p1beta1.ImageAnnotator + * @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 {ImageAnnotator} RPC service. Useful where requests and/or responses are streamed. + */ + ImageAnnotator.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1p1beta1.ImageAnnotator#batchAnnotateImages}. + * @memberof google.cloud.vision.v1p1beta1.ImageAnnotator + * @typedef BatchAnnotateImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse} [response] BatchAnnotateImagesResponse + */ + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p1beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @param {google.cloud.vision.v1p1beta1.ImageAnnotator.BatchAnnotateImagesCallback} callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.batchAnnotateImages = function batchAnnotateImages(request, callback) { + return this.rpcCall(batchAnnotateImages, $root.google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest, $root.google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse, request, callback); + }, "name", { value: "BatchAnnotateImages" }); + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p1beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ImageAnnotator; + })(); + + v1p1beta1.Feature = (function() { + + /** + * Properties of a Feature. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IFeature + * @property {google.cloud.vision.v1p1beta1.Feature.Type|null} [type] Feature type + * @property {number|null} [maxResults] Feature maxResults + * @property {string|null} [model] Feature model + */ + + /** + * Constructs a new Feature. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Feature. + * @implements IFeature + * @constructor + * @param {google.cloud.vision.v1p1beta1.IFeature=} [properties] Properties to set + */ + function Feature(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]]; + } + + /** + * Feature type. + * @member {google.cloud.vision.v1p1beta1.Feature.Type} type + * @memberof google.cloud.vision.v1p1beta1.Feature + * @instance + */ + Feature.prototype.type = 0; + + /** + * Feature maxResults. + * @member {number} maxResults + * @memberof google.cloud.vision.v1p1beta1.Feature + * @instance + */ + Feature.prototype.maxResults = 0; + + /** + * Feature model. + * @member {string} model + * @memberof google.cloud.vision.v1p1beta1.Feature + * @instance + */ + Feature.prototype.model = ""; + + /** + * Creates a new Feature instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {google.cloud.vision.v1p1beta1.IFeature=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Feature} Feature instance + */ + Feature.create = function create(properties) { + return new Feature(properties); + }; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Feature.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {google.cloud.vision.v1p1beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxResults); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Feature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {google.cloud.vision.v1p1beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.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.vision.v1p1beta1.Feature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.maxResults = reader.int32(); + break; + case 3: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feature message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 11: + case 6: + case 7: + case 9: + case 10: + break; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Feature} Feature + */ + Feature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Feature) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Feature(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "FACE_DETECTION": + case 1: + message.type = 1; + break; + case "LANDMARK_DETECTION": + case 2: + message.type = 2; + break; + case "LOGO_DETECTION": + case 3: + message.type = 3; + break; + case "LABEL_DETECTION": + case 4: + message.type = 4; + break; + case "TEXT_DETECTION": + case 5: + message.type = 5; + break; + case "DOCUMENT_TEXT_DETECTION": + case 11: + message.type = 11; + break; + case "SAFE_SEARCH_DETECTION": + case 6: + message.type = 6; + break; + case "IMAGE_PROPERTIES": + case 7: + message.type = 7; + break; + case "CROP_HINTS": + case 9: + message.type = 9; + break; + case "WEB_DETECTION": + case 10: + message.type = 10; + break; + } + if (object.maxResults != null) + message.maxResults = object.maxResults | 0; + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Feature + * @static + * @param {google.cloud.vision.v1p1beta1.Feature} message Feature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.maxResults = 0; + object.model = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Feature.Type[message.type] : message.type; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + object.maxResults = message.maxResults; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this Feature to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Feature + * @instance + * @returns {Object.} JSON object + */ + Feature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p1beta1.Feature.Type + * @enum {string} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} FACE_DETECTION=1 FACE_DETECTION value + * @property {number} LANDMARK_DETECTION=2 LANDMARK_DETECTION value + * @property {number} LOGO_DETECTION=3 LOGO_DETECTION value + * @property {number} LABEL_DETECTION=4 LABEL_DETECTION value + * @property {number} TEXT_DETECTION=5 TEXT_DETECTION value + * @property {number} DOCUMENT_TEXT_DETECTION=11 DOCUMENT_TEXT_DETECTION value + * @property {number} SAFE_SEARCH_DETECTION=6 SAFE_SEARCH_DETECTION value + * @property {number} IMAGE_PROPERTIES=7 IMAGE_PROPERTIES value + * @property {number} CROP_HINTS=9 CROP_HINTS value + * @property {number} WEB_DETECTION=10 WEB_DETECTION value + */ + Feature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACE_DETECTION"] = 1; + values[valuesById[2] = "LANDMARK_DETECTION"] = 2; + values[valuesById[3] = "LOGO_DETECTION"] = 3; + values[valuesById[4] = "LABEL_DETECTION"] = 4; + values[valuesById[5] = "TEXT_DETECTION"] = 5; + values[valuesById[11] = "DOCUMENT_TEXT_DETECTION"] = 11; + values[valuesById[6] = "SAFE_SEARCH_DETECTION"] = 6; + values[valuesById[7] = "IMAGE_PROPERTIES"] = 7; + values[valuesById[9] = "CROP_HINTS"] = 9; + values[valuesById[10] = "WEB_DETECTION"] = 10; + return values; + })(); + + return Feature; + })(); + + v1p1beta1.ImageSource = (function() { + + /** + * Properties of an ImageSource. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IImageSource + * @property {string|null} [gcsImageUri] ImageSource gcsImageUri + * @property {string|null} [imageUri] ImageSource imageUri + */ + + /** + * Constructs a new ImageSource. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an ImageSource. + * @implements IImageSource + * @constructor + * @param {google.cloud.vision.v1p1beta1.IImageSource=} [properties] Properties to set + */ + function ImageSource(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]]; + } + + /** + * ImageSource gcsImageUri. + * @member {string} gcsImageUri + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @instance + */ + ImageSource.prototype.gcsImageUri = ""; + + /** + * ImageSource imageUri. + * @member {string} imageUri + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @instance + */ + ImageSource.prototype.imageUri = ""; + + /** + * Creates a new ImageSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p1beta1.IImageSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.ImageSource} ImageSource instance + */ + ImageSource.create = function create(properties) { + return new ImageSource(properties); + }; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p1beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsImageUri); + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageUri); + return writer; + }; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p1beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.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.vision.v1p1beta1.ImageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsImageUri = reader.string(); + break; + case 2: + message.imageUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSource message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + if (!$util.isString(message.gcsImageUri)) + return "gcsImageUri: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + return null; + }; + + /** + * Creates an ImageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.ImageSource} ImageSource + */ + ImageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.ImageSource) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.ImageSource(); + if (object.gcsImageUri != null) + message.gcsImageUri = String(object.gcsImageUri); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + return message; + }; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p1beta1.ImageSource} message ImageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsImageUri = ""; + object.imageUri = ""; + } + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + object.gcsImageUri = message.gcsImageUri; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + return object; + }; + + /** + * Converts this ImageSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.ImageSource + * @instance + * @returns {Object.} JSON object + */ + ImageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageSource; + })(); + + v1p1beta1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IImage + * @property {Uint8Array|null} [content] Image content + * @property {google.cloud.vision.v1p1beta1.IImageSource|null} [source] Image source + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.vision.v1p1beta1.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 content. + * @member {Uint8Array} content + * @memberof google.cloud.vision.v1p1beta1.Image + * @instance + */ + Image.prototype.content = $util.newBuffer([]); + + /** + * Image source. + * @member {google.cloud.vision.v1p1beta1.IImageSource|null|undefined} source + * @memberof google.cloud.vision.v1p1beta1.Image + * @instance + */ + Image.prototype.source = null; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Image + * @static + * @param {google.cloud.vision.v1p1beta1.IImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Image + * @static + * @param {google.cloud.vision.v1p1beta1.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.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.vision.v1p1beta1.ImageSource.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Image + * @static + * @param {google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.bytes(); + break; + case 2: + message.source = $root.google.cloud.vision.v1p1beta1.ImageSource.decode(reader, reader.uint32()); + 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.vision.v1p1beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.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"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.vision.v1p1beta1.ImageSource.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Image) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Image(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Image.source: object expected"); + message.source = $root.google.cloud.vision.v1p1beta1.ImageSource.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Image + * @static + * @param {google.cloud.vision.v1p1beta1.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) { + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + object.source = null; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.vision.v1p1beta1.ImageSource.toObject(message.source, options); + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Image; + })(); + + v1p1beta1.FaceAnnotation = (function() { + + /** + * Properties of a FaceAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IFaceAnnotation + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [boundingPoly] FaceAnnotation boundingPoly + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [fdBoundingPoly] FaceAnnotation fdBoundingPoly + * @property {Array.|null} [landmarks] FaceAnnotation landmarks + * @property {number|null} [rollAngle] FaceAnnotation rollAngle + * @property {number|null} [panAngle] FaceAnnotation panAngle + * @property {number|null} [tiltAngle] FaceAnnotation tiltAngle + * @property {number|null} [detectionConfidence] FaceAnnotation detectionConfidence + * @property {number|null} [landmarkingConfidence] FaceAnnotation landmarkingConfidence + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [joyLikelihood] FaceAnnotation joyLikelihood + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [sorrowLikelihood] FaceAnnotation sorrowLikelihood + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [angerLikelihood] FaceAnnotation angerLikelihood + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [surpriseLikelihood] FaceAnnotation surpriseLikelihood + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [underExposedLikelihood] FaceAnnotation underExposedLikelihood + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [blurredLikelihood] FaceAnnotation blurredLikelihood + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [headwearLikelihood] FaceAnnotation headwearLikelihood + */ + + /** + * Constructs a new FaceAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a FaceAnnotation. + * @implements IFaceAnnotation + * @constructor + * @param {google.cloud.vision.v1p1beta1.IFaceAnnotation=} [properties] Properties to set + */ + function FaceAnnotation(properties) { + this.landmarks = []; + 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]]; + } + + /** + * FaceAnnotation boundingPoly. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.boundingPoly = null; + + /** + * FaceAnnotation fdBoundingPoly. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} fdBoundingPoly + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.fdBoundingPoly = null; + + /** + * FaceAnnotation landmarks. + * @member {Array.} landmarks + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarks = $util.emptyArray; + + /** + * FaceAnnotation rollAngle. + * @member {number} rollAngle + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.rollAngle = 0; + + /** + * FaceAnnotation panAngle. + * @member {number} panAngle + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.panAngle = 0; + + /** + * FaceAnnotation tiltAngle. + * @member {number} tiltAngle + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.tiltAngle = 0; + + /** + * FaceAnnotation detectionConfidence. + * @member {number} detectionConfidence + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.detectionConfidence = 0; + + /** + * FaceAnnotation landmarkingConfidence. + * @member {number} landmarkingConfidence + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarkingConfidence = 0; + + /** + * FaceAnnotation joyLikelihood. + * @member {google.cloud.vision.v1p1beta1.Likelihood} joyLikelihood + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.joyLikelihood = 0; + + /** + * FaceAnnotation sorrowLikelihood. + * @member {google.cloud.vision.v1p1beta1.Likelihood} sorrowLikelihood + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.sorrowLikelihood = 0; + + /** + * FaceAnnotation angerLikelihood. + * @member {google.cloud.vision.v1p1beta1.Likelihood} angerLikelihood + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.angerLikelihood = 0; + + /** + * FaceAnnotation surpriseLikelihood. + * @member {google.cloud.vision.v1p1beta1.Likelihood} surpriseLikelihood + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.surpriseLikelihood = 0; + + /** + * FaceAnnotation underExposedLikelihood. + * @member {google.cloud.vision.v1p1beta1.Likelihood} underExposedLikelihood + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.underExposedLikelihood = 0; + + /** + * FaceAnnotation blurredLikelihood. + * @member {google.cloud.vision.v1p1beta1.Likelihood} blurredLikelihood + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.blurredLikelihood = 0; + + /** + * FaceAnnotation headwearLikelihood. + * @member {google.cloud.vision.v1p1beta1.Likelihood} headwearLikelihood + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.headwearLikelihood = 0; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IFaceAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation} FaceAnnotation instance + */ + FaceAnnotation.create = function create(properties) { + return new FaceAnnotation(properties); + }; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.fdBoundingPoly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.landmarks != null && message.landmarks.length) + for (var i = 0; i < message.landmarks.length; ++i) + $root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.encode(message.landmarks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.rollAngle); + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.panAngle); + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.tiltAngle); + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.detectionConfidence); + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.landmarkingConfidence); + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.joyLikelihood); + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sorrowLikelihood); + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.angerLikelihood); + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.surpriseLikelihood); + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.underExposedLikelihood); + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.blurredLikelihood); + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.headwearLikelihood); + return writer; + }; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.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.vision.v1p1beta1.FaceAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.fdBoundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.landmarks && message.landmarks.length)) + message.landmarks = []; + message.landmarks.push($root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.decode(reader, reader.uint32())); + break; + case 4: + message.rollAngle = reader.float(); + break; + case 5: + message.panAngle = reader.float(); + break; + case 6: + message.tiltAngle = reader.float(); + break; + case 7: + message.detectionConfidence = reader.float(); + break; + case 8: + message.landmarkingConfidence = reader.float(); + break; + case 9: + message.joyLikelihood = reader.int32(); + break; + case 10: + message.sorrowLikelihood = reader.int32(); + break; + case 11: + message.angerLikelihood = reader.int32(); + break; + case 12: + message.surpriseLikelihood = reader.int32(); + break; + case 13: + message.underExposedLikelihood = reader.int32(); + break; + case 14: + message.blurredLikelihood = reader.int32(); + break; + case 15: + message.headwearLikelihood = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.fdBoundingPoly); + if (error) + return "fdBoundingPoly." + error; + } + if (message.landmarks != null && message.hasOwnProperty("landmarks")) { + if (!Array.isArray(message.landmarks)) + return "landmarks: array expected"; + for (var i = 0; i < message.landmarks.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.verify(message.landmarks[i]); + if (error) + return "landmarks." + error; + } + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + if (typeof message.rollAngle !== "number") + return "rollAngle: number expected"; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + if (typeof message.panAngle !== "number") + return "panAngle: number expected"; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + if (typeof message.tiltAngle !== "number") + return "tiltAngle: number expected"; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + if (typeof message.detectionConfidence !== "number") + return "detectionConfidence: number expected"; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + if (typeof message.landmarkingConfidence !== "number") + return "landmarkingConfidence: number expected"; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + switch (message.joyLikelihood) { + default: + return "joyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + switch (message.sorrowLikelihood) { + default: + return "sorrowLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + switch (message.angerLikelihood) { + default: + return "angerLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + switch (message.surpriseLikelihood) { + default: + return "surpriseLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + switch (message.underExposedLikelihood) { + default: + return "underExposedLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + switch (message.blurredLikelihood) { + default: + return "blurredLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + switch (message.headwearLikelihood) { + default: + return "headwearLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation} FaceAnnotation + */ + FaceAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.FaceAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.FaceAnnotation(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.FaceAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.fdBoundingPoly != null) { + if (typeof object.fdBoundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.FaceAnnotation.fdBoundingPoly: object expected"); + message.fdBoundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.fdBoundingPoly); + } + if (object.landmarks) { + if (!Array.isArray(object.landmarks)) + throw TypeError(".google.cloud.vision.v1p1beta1.FaceAnnotation.landmarks: array expected"); + message.landmarks = []; + for (var i = 0; i < object.landmarks.length; ++i) { + if (typeof object.landmarks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.FaceAnnotation.landmarks: object expected"); + message.landmarks[i] = $root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.fromObject(object.landmarks[i]); + } + } + if (object.rollAngle != null) + message.rollAngle = Number(object.rollAngle); + if (object.panAngle != null) + message.panAngle = Number(object.panAngle); + if (object.tiltAngle != null) + message.tiltAngle = Number(object.tiltAngle); + if (object.detectionConfidence != null) + message.detectionConfidence = Number(object.detectionConfidence); + if (object.landmarkingConfidence != null) + message.landmarkingConfidence = Number(object.landmarkingConfidence); + switch (object.joyLikelihood) { + case "UNKNOWN": + case 0: + message.joyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.joyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.joyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.joyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.joyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.joyLikelihood = 5; + break; + } + switch (object.sorrowLikelihood) { + case "UNKNOWN": + case 0: + message.sorrowLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.sorrowLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.sorrowLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.sorrowLikelihood = 3; + break; + case "LIKELY": + case 4: + message.sorrowLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.sorrowLikelihood = 5; + break; + } + switch (object.angerLikelihood) { + case "UNKNOWN": + case 0: + message.angerLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.angerLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.angerLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.angerLikelihood = 3; + break; + case "LIKELY": + case 4: + message.angerLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.angerLikelihood = 5; + break; + } + switch (object.surpriseLikelihood) { + case "UNKNOWN": + case 0: + message.surpriseLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.surpriseLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.surpriseLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.surpriseLikelihood = 3; + break; + case "LIKELY": + case 4: + message.surpriseLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.surpriseLikelihood = 5; + break; + } + switch (object.underExposedLikelihood) { + case "UNKNOWN": + case 0: + message.underExposedLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.underExposedLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.underExposedLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.underExposedLikelihood = 3; + break; + case "LIKELY": + case 4: + message.underExposedLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.underExposedLikelihood = 5; + break; + } + switch (object.blurredLikelihood) { + case "UNKNOWN": + case 0: + message.blurredLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.blurredLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.blurredLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.blurredLikelihood = 3; + break; + case "LIKELY": + case 4: + message.blurredLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.blurredLikelihood = 5; + break; + } + switch (object.headwearLikelihood) { + case "UNKNOWN": + case 0: + message.headwearLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.headwearLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.headwearLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.headwearLikelihood = 3; + break; + case "LIKELY": + case 4: + message.headwearLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.headwearLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.FaceAnnotation} message FaceAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.landmarks = []; + if (options.defaults) { + object.boundingPoly = null; + object.fdBoundingPoly = null; + object.rollAngle = 0; + object.panAngle = 0; + object.tiltAngle = 0; + object.detectionConfidence = 0; + object.landmarkingConfidence = 0; + object.joyLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.sorrowLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.angerLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.surpriseLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.underExposedLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.blurredLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.headwearLikelihood = options.enums === String ? "UNKNOWN" : 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + object.fdBoundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.fdBoundingPoly, options); + if (message.landmarks && message.landmarks.length) { + object.landmarks = []; + for (var j = 0; j < message.landmarks.length; ++j) + object.landmarks[j] = $root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.toObject(message.landmarks[j], options); + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + object.rollAngle = options.json && !isFinite(message.rollAngle) ? String(message.rollAngle) : message.rollAngle; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + object.panAngle = options.json && !isFinite(message.panAngle) ? String(message.panAngle) : message.panAngle; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + object.tiltAngle = options.json && !isFinite(message.tiltAngle) ? String(message.tiltAngle) : message.tiltAngle; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + object.detectionConfidence = options.json && !isFinite(message.detectionConfidence) ? String(message.detectionConfidence) : message.detectionConfidence; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + object.landmarkingConfidence = options.json && !isFinite(message.landmarkingConfidence) ? String(message.landmarkingConfidence) : message.landmarkingConfidence; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + object.joyLikelihood = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.joyLikelihood] : message.joyLikelihood; + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + object.sorrowLikelihood = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.sorrowLikelihood] : message.sorrowLikelihood; + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + object.angerLikelihood = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.angerLikelihood] : message.angerLikelihood; + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + object.surpriseLikelihood = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.surpriseLikelihood] : message.surpriseLikelihood; + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + object.underExposedLikelihood = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.underExposedLikelihood] : message.underExposedLikelihood; + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + object.blurredLikelihood = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.blurredLikelihood] : message.blurredLikelihood; + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + object.headwearLikelihood = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.headwearLikelihood] : message.headwearLikelihood; + return object; + }; + + /** + * Converts this FaceAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FaceAnnotation.Landmark = (function() { + + /** + * Properties of a Landmark. + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @interface ILandmark + * @property {google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type|null} [type] Landmark type + * @property {google.cloud.vision.v1p1beta1.IPosition|null} [position] Landmark position + */ + + /** + * Constructs a new Landmark. + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation + * @classdesc Represents a Landmark. + * @implements ILandmark + * @constructor + * @param {google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + */ + function Landmark(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]]; + } + + /** + * Landmark type. + * @member {google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type} type + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.type = 0; + + /** + * Landmark position. + * @member {google.cloud.vision.v1p1beta1.IPosition|null|undefined} position + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.position = null; + + /** + * Creates a new Landmark instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark} Landmark instance + */ + Landmark.create = function create(properties) { + return new Landmark(properties); + }; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.position != null && message.hasOwnProperty("position")) + $root.google.cloud.vision.v1p1beta1.Position.encode(message.position, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p1beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.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.vision.v1p1beta1.FaceAnnotation.Landmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.type = reader.int32(); + break; + case 4: + message.position = $root.google.cloud.vision.v1p1beta1.Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Landmark message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Landmark.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + break; + } + if (message.position != null && message.hasOwnProperty("position")) { + var error = $root.google.cloud.vision.v1p1beta1.Position.verify(message.position); + if (error) + return "position." + error; + } + return null; + }; + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark} Landmark + */ + Landmark.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark(); + switch (object.type) { + case "UNKNOWN_LANDMARK": + case 0: + message.type = 0; + break; + case "LEFT_EYE": + case 1: + message.type = 1; + break; + case "RIGHT_EYE": + case 2: + message.type = 2; + break; + case "LEFT_OF_LEFT_EYEBROW": + case 3: + message.type = 3; + break; + case "RIGHT_OF_LEFT_EYEBROW": + case 4: + message.type = 4; + break; + case "LEFT_OF_RIGHT_EYEBROW": + case 5: + message.type = 5; + break; + case "RIGHT_OF_RIGHT_EYEBROW": + case 6: + message.type = 6; + break; + case "MIDPOINT_BETWEEN_EYES": + case 7: + message.type = 7; + break; + case "NOSE_TIP": + case 8: + message.type = 8; + break; + case "UPPER_LIP": + case 9: + message.type = 9; + break; + case "LOWER_LIP": + case 10: + message.type = 10; + break; + case "MOUTH_LEFT": + case 11: + message.type = 11; + break; + case "MOUTH_RIGHT": + case 12: + message.type = 12; + break; + case "MOUTH_CENTER": + case 13: + message.type = 13; + break; + case "NOSE_BOTTOM_RIGHT": + case 14: + message.type = 14; + break; + case "NOSE_BOTTOM_LEFT": + case 15: + message.type = 15; + break; + case "NOSE_BOTTOM_CENTER": + case 16: + message.type = 16; + break; + case "LEFT_EYE_TOP_BOUNDARY": + case 17: + message.type = 17; + break; + case "LEFT_EYE_RIGHT_CORNER": + case 18: + message.type = 18; + break; + case "LEFT_EYE_BOTTOM_BOUNDARY": + case 19: + message.type = 19; + break; + case "LEFT_EYE_LEFT_CORNER": + case 20: + message.type = 20; + break; + case "RIGHT_EYE_TOP_BOUNDARY": + case 21: + message.type = 21; + break; + case "RIGHT_EYE_RIGHT_CORNER": + case 22: + message.type = 22; + break; + case "RIGHT_EYE_BOTTOM_BOUNDARY": + case 23: + message.type = 23; + break; + case "RIGHT_EYE_LEFT_CORNER": + case 24: + message.type = 24; + break; + case "LEFT_EYEBROW_UPPER_MIDPOINT": + case 25: + message.type = 25; + break; + case "RIGHT_EYEBROW_UPPER_MIDPOINT": + case 26: + message.type = 26; + break; + case "LEFT_EAR_TRAGION": + case 27: + message.type = 27; + break; + case "RIGHT_EAR_TRAGION": + case 28: + message.type = 28; + break; + case "LEFT_EYE_PUPIL": + case 29: + message.type = 29; + break; + case "RIGHT_EYE_PUPIL": + case 30: + message.type = 30; + break; + case "FOREHEAD_GLABELLA": + case 31: + message.type = 31; + break; + case "CHIN_GNATHION": + case 32: + message.type = 32; + break; + case "CHIN_LEFT_GONION": + case 33: + message.type = 33; + break; + case "CHIN_RIGHT_GONION": + case 34: + message.type = 34; + break; + } + if (object.position != null) { + if (typeof object.position !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.position: object expected"); + message.position = $root.google.cloud.vision.v1p1beta1.Position.fromObject(object.position); + } + return message; + }; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark} message Landmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Landmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN_LANDMARK" : 0; + object.position = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type[message.type] : message.type; + if (message.position != null && message.hasOwnProperty("position")) + object.position = $root.google.cloud.vision.v1p1beta1.Position.toObject(message.position, options); + return object; + }; + + /** + * Converts this Landmark to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark + * @instance + * @returns {Object.} JSON object + */ + Landmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type + * @enum {string} + * @property {number} UNKNOWN_LANDMARK=0 UNKNOWN_LANDMARK value + * @property {number} LEFT_EYE=1 LEFT_EYE value + * @property {number} RIGHT_EYE=2 RIGHT_EYE value + * @property {number} LEFT_OF_LEFT_EYEBROW=3 LEFT_OF_LEFT_EYEBROW value + * @property {number} RIGHT_OF_LEFT_EYEBROW=4 RIGHT_OF_LEFT_EYEBROW value + * @property {number} LEFT_OF_RIGHT_EYEBROW=5 LEFT_OF_RIGHT_EYEBROW value + * @property {number} RIGHT_OF_RIGHT_EYEBROW=6 RIGHT_OF_RIGHT_EYEBROW value + * @property {number} MIDPOINT_BETWEEN_EYES=7 MIDPOINT_BETWEEN_EYES value + * @property {number} NOSE_TIP=8 NOSE_TIP value + * @property {number} UPPER_LIP=9 UPPER_LIP value + * @property {number} LOWER_LIP=10 LOWER_LIP value + * @property {number} MOUTH_LEFT=11 MOUTH_LEFT value + * @property {number} MOUTH_RIGHT=12 MOUTH_RIGHT value + * @property {number} MOUTH_CENTER=13 MOUTH_CENTER value + * @property {number} NOSE_BOTTOM_RIGHT=14 NOSE_BOTTOM_RIGHT value + * @property {number} NOSE_BOTTOM_LEFT=15 NOSE_BOTTOM_LEFT value + * @property {number} NOSE_BOTTOM_CENTER=16 NOSE_BOTTOM_CENTER value + * @property {number} LEFT_EYE_TOP_BOUNDARY=17 LEFT_EYE_TOP_BOUNDARY value + * @property {number} LEFT_EYE_RIGHT_CORNER=18 LEFT_EYE_RIGHT_CORNER value + * @property {number} LEFT_EYE_BOTTOM_BOUNDARY=19 LEFT_EYE_BOTTOM_BOUNDARY value + * @property {number} LEFT_EYE_LEFT_CORNER=20 LEFT_EYE_LEFT_CORNER value + * @property {number} RIGHT_EYE_TOP_BOUNDARY=21 RIGHT_EYE_TOP_BOUNDARY value + * @property {number} RIGHT_EYE_RIGHT_CORNER=22 RIGHT_EYE_RIGHT_CORNER value + * @property {number} RIGHT_EYE_BOTTOM_BOUNDARY=23 RIGHT_EYE_BOTTOM_BOUNDARY value + * @property {number} RIGHT_EYE_LEFT_CORNER=24 RIGHT_EYE_LEFT_CORNER value + * @property {number} LEFT_EYEBROW_UPPER_MIDPOINT=25 LEFT_EYEBROW_UPPER_MIDPOINT value + * @property {number} RIGHT_EYEBROW_UPPER_MIDPOINT=26 RIGHT_EYEBROW_UPPER_MIDPOINT value + * @property {number} LEFT_EAR_TRAGION=27 LEFT_EAR_TRAGION value + * @property {number} RIGHT_EAR_TRAGION=28 RIGHT_EAR_TRAGION value + * @property {number} LEFT_EYE_PUPIL=29 LEFT_EYE_PUPIL value + * @property {number} RIGHT_EYE_PUPIL=30 RIGHT_EYE_PUPIL value + * @property {number} FOREHEAD_GLABELLA=31 FOREHEAD_GLABELLA value + * @property {number} CHIN_GNATHION=32 CHIN_GNATHION value + * @property {number} CHIN_LEFT_GONION=33 CHIN_LEFT_GONION value + * @property {number} CHIN_RIGHT_GONION=34 CHIN_RIGHT_GONION value + */ + Landmark.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_LANDMARK"] = 0; + values[valuesById[1] = "LEFT_EYE"] = 1; + values[valuesById[2] = "RIGHT_EYE"] = 2; + values[valuesById[3] = "LEFT_OF_LEFT_EYEBROW"] = 3; + values[valuesById[4] = "RIGHT_OF_LEFT_EYEBROW"] = 4; + values[valuesById[5] = "LEFT_OF_RIGHT_EYEBROW"] = 5; + values[valuesById[6] = "RIGHT_OF_RIGHT_EYEBROW"] = 6; + values[valuesById[7] = "MIDPOINT_BETWEEN_EYES"] = 7; + values[valuesById[8] = "NOSE_TIP"] = 8; + values[valuesById[9] = "UPPER_LIP"] = 9; + values[valuesById[10] = "LOWER_LIP"] = 10; + values[valuesById[11] = "MOUTH_LEFT"] = 11; + values[valuesById[12] = "MOUTH_RIGHT"] = 12; + values[valuesById[13] = "MOUTH_CENTER"] = 13; + values[valuesById[14] = "NOSE_BOTTOM_RIGHT"] = 14; + values[valuesById[15] = "NOSE_BOTTOM_LEFT"] = 15; + values[valuesById[16] = "NOSE_BOTTOM_CENTER"] = 16; + values[valuesById[17] = "LEFT_EYE_TOP_BOUNDARY"] = 17; + values[valuesById[18] = "LEFT_EYE_RIGHT_CORNER"] = 18; + values[valuesById[19] = "LEFT_EYE_BOTTOM_BOUNDARY"] = 19; + values[valuesById[20] = "LEFT_EYE_LEFT_CORNER"] = 20; + values[valuesById[21] = "RIGHT_EYE_TOP_BOUNDARY"] = 21; + values[valuesById[22] = "RIGHT_EYE_RIGHT_CORNER"] = 22; + values[valuesById[23] = "RIGHT_EYE_BOTTOM_BOUNDARY"] = 23; + values[valuesById[24] = "RIGHT_EYE_LEFT_CORNER"] = 24; + values[valuesById[25] = "LEFT_EYEBROW_UPPER_MIDPOINT"] = 25; + values[valuesById[26] = "RIGHT_EYEBROW_UPPER_MIDPOINT"] = 26; + values[valuesById[27] = "LEFT_EAR_TRAGION"] = 27; + values[valuesById[28] = "RIGHT_EAR_TRAGION"] = 28; + values[valuesById[29] = "LEFT_EYE_PUPIL"] = 29; + values[valuesById[30] = "RIGHT_EYE_PUPIL"] = 30; + values[valuesById[31] = "FOREHEAD_GLABELLA"] = 31; + values[valuesById[32] = "CHIN_GNATHION"] = 32; + values[valuesById[33] = "CHIN_LEFT_GONION"] = 33; + values[valuesById[34] = "CHIN_RIGHT_GONION"] = 34; + return values; + })(); + + return Landmark; + })(); + + return FaceAnnotation; + })(); + + v1p1beta1.LocationInfo = (function() { + + /** + * Properties of a LocationInfo. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ILocationInfo + * @property {google.type.ILatLng|null} [latLng] LocationInfo latLng + */ + + /** + * Constructs a new LocationInfo. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo + * @constructor + * @param {google.cloud.vision.v1p1beta1.ILocationInfo=} [properties] Properties to set + */ + function LocationInfo(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]]; + } + + /** + * LocationInfo latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @instance + */ + LocationInfo.prototype.latLng = null; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p1beta1.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.LocationInfo} LocationInfo instance + */ + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); + }; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p1beta1.LocationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p1beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && message.hasOwnProperty("latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.LocationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p1beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.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.vision.v1p1beta1.LocationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationInfo message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + return null; + }; + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.LocationInfo} LocationInfo + */ + LocationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.LocationInfo) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.LocationInfo(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.LocationInfo.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + return message; + }; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p1beta1.LocationInfo} message LocationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.latLng = null; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + return object; + }; + + /** + * Converts this LocationInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.LocationInfo + * @instance + * @returns {Object.} JSON object + */ + LocationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationInfo; + })(); + + v1p1beta1.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [value] Property value + * @property {number|Long|null} [uint64Value] Property uint64Value + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.vision.v1p1beta1.IProperty=} [properties] Properties to set + */ + function Property(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]]; + } + + /** + * Property name. + * @member {string} name + * @memberof google.cloud.vision.v1p1beta1.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property value. + * @member {string} value + * @memberof google.cloud.vision.v1p1beta1.Property + * @instance + */ + Property.prototype.value = ""; + + /** + * Property uint64Value. + * @member {number|Long} uint64Value + * @memberof google.cloud.vision.v1p1beta1.Property + * @instance + */ + Property.prototype.uint64Value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {google.cloud.vision.v1p1beta1.IProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {google.cloud.vision.v1p1beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.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.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.uint64Value); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {google.cloud.vision.v1p1beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Property message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.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.vision.v1p1beta1.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.uint64Value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Property message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Property.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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (!$util.isInteger(message.uint64Value) && !(message.uint64Value && $util.isInteger(message.uint64Value.low) && $util.isInteger(message.uint64Value.high))) + return "uint64Value: integer|Long expected"; + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Property) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.uint64Value != null) + if ($util.Long) + (message.uint64Value = $util.Long.fromValue(object.uint64Value)).unsigned = true; + else if (typeof object.uint64Value === "string") + message.uint64Value = parseInt(object.uint64Value, 10); + else if (typeof object.uint64Value === "number") + message.uint64Value = object.uint64Value; + else if (typeof object.uint64Value === "object") + message.uint64Value = new $util.LongBits(object.uint64Value.low >>> 0, object.uint64Value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Property + * @static + * @param {google.cloud.vision.v1p1beta1.Property} message Property + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Property.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.uint64Value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.uint64Value = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (typeof message.uint64Value === "number") + object.uint64Value = options.longs === String ? String(message.uint64Value) : message.uint64Value; + else + object.uint64Value = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Value) : options.longs === Number ? new $util.LongBits(message.uint64Value.low >>> 0, message.uint64Value.high >>> 0).toNumber(true) : message.uint64Value; + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Property + * @instance + * @returns {Object.} JSON object + */ + Property.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Property; + })(); + + v1p1beta1.EntityAnnotation = (function() { + + /** + * Properties of an EntityAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IEntityAnnotation + * @property {string|null} [mid] EntityAnnotation mid + * @property {string|null} [locale] EntityAnnotation locale + * @property {string|null} [description] EntityAnnotation description + * @property {number|null} [score] EntityAnnotation score + * @property {number|null} [confidence] EntityAnnotation confidence + * @property {number|null} [topicality] EntityAnnotation topicality + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [boundingPoly] EntityAnnotation boundingPoly + * @property {Array.|null} [locations] EntityAnnotation locations + * @property {Array.|null} [properties] EntityAnnotation properties + */ + + /** + * Constructs a new EntityAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an EntityAnnotation. + * @implements IEntityAnnotation + * @constructor + * @param {google.cloud.vision.v1p1beta1.IEntityAnnotation=} [properties] Properties to set + */ + function EntityAnnotation(properties) { + this.locations = []; + this.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]]; + } + + /** + * EntityAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.mid = ""; + + /** + * EntityAnnotation locale. + * @member {string} locale + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locale = ""; + + /** + * EntityAnnotation description. + * @member {string} description + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.description = ""; + + /** + * EntityAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.score = 0; + + /** + * EntityAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.confidence = 0; + + /** + * EntityAnnotation topicality. + * @member {number} topicality + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.topicality = 0; + + /** + * EntityAnnotation boundingPoly. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.boundingPoly = null; + + /** + * EntityAnnotation locations. + * @member {Array.} locations + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locations = $util.emptyArray; + + /** + * EntityAnnotation properties. + * @member {Array.} properties + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.properties = $util.emptyArray; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IEntityAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.EntityAnnotation} EntityAnnotation instance + */ + EntityAnnotation.create = function create(properties) { + return new EntityAnnotation(properties); + }; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.EntityAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.locale != null && message.hasOwnProperty("locale")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.locale); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.topicality != null && message.hasOwnProperty("topicality")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicality); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.vision.v1p1beta1.LocationInfo.encode(message.locations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.vision.v1p1beta1.Property.encode(message.properties[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.EntityAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.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.vision.v1p1beta1.EntityAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.locale = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.confidence = reader.float(); + break; + case 6: + message.topicality = reader.float(); + break; + case 7: + message.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.vision.v1p1beta1.LocationInfo.decode(reader, reader.uint32())); + break; + case 9: + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.vision.v1p1beta1.Property.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.locale != null && message.hasOwnProperty("locale")) + if (!$util.isString(message.locale)) + return "locale: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.topicality != null && message.hasOwnProperty("topicality")) + if (typeof message.topicality !== "number") + return "topicality: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.LocationInfo.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates an EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.EntityAnnotation} EntityAnnotation + */ + EntityAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.EntityAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.EntityAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.locale != null) + message.locale = String(object.locale); + if (object.description != null) + message.description = String(object.description); + if (object.score != null) + message.score = Number(object.score); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.topicality != null) + message.topicality = Number(object.topicality); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.EntityAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.vision.v1p1beta1.EntityAnnotation.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.EntityAnnotation.locations: object expected"); + message.locations[i] = $root.google.cloud.vision.v1p1beta1.LocationInfo.fromObject(object.locations[i]); + } + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.vision.v1p1beta1.EntityAnnotation.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.EntityAnnotation.properties: object expected"); + message.properties[i] = $root.google.cloud.vision.v1p1beta1.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.EntityAnnotation} message EntityAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locations = []; + object.properties = []; + } + if (options.defaults) { + object.mid = ""; + object.locale = ""; + object.description = ""; + object.score = 0; + object.confidence = 0; + object.topicality = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.locale != null && message.hasOwnProperty("locale")) + object.locale = message.locale; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.topicality != null && message.hasOwnProperty("topicality")) + object.topicality = options.json && !isFinite(message.topicality) ? String(message.topicality) : message.topicality; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.vision.v1p1beta1.LocationInfo.toObject(message.locations[j], options); + } + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.vision.v1p1beta1.Property.toObject(message.properties[j], options); + } + return object; + }; + + /** + * Converts this EntityAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.EntityAnnotation + * @instance + * @returns {Object.} JSON object + */ + EntityAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EntityAnnotation; + })(); + + v1p1beta1.SafeSearchAnnotation = (function() { + + /** + * Properties of a SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ISafeSearchAnnotation + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [adult] SafeSearchAnnotation adult + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [spoof] SafeSearchAnnotation spoof + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [medical] SafeSearchAnnotation medical + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [violence] SafeSearchAnnotation violence + * @property {google.cloud.vision.v1p1beta1.Likelihood|null} [racy] SafeSearchAnnotation racy + */ + + /** + * Constructs a new SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a SafeSearchAnnotation. + * @implements ISafeSearchAnnotation + * @constructor + * @param {google.cloud.vision.v1p1beta1.ISafeSearchAnnotation=} [properties] Properties to set + */ + function SafeSearchAnnotation(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]]; + } + + /** + * SafeSearchAnnotation adult. + * @member {google.cloud.vision.v1p1beta1.Likelihood} adult + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.adult = 0; + + /** + * SafeSearchAnnotation spoof. + * @member {google.cloud.vision.v1p1beta1.Likelihood} spoof + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.spoof = 0; + + /** + * SafeSearchAnnotation medical. + * @member {google.cloud.vision.v1p1beta1.Likelihood} medical + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.medical = 0; + + /** + * SafeSearchAnnotation violence. + * @member {google.cloud.vision.v1p1beta1.Likelihood} violence + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.violence = 0; + + /** + * SafeSearchAnnotation racy. + * @member {google.cloud.vision.v1p1beta1.Likelihood} racy + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.racy = 0; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ISafeSearchAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.SafeSearchAnnotation} SafeSearchAnnotation instance + */ + SafeSearchAnnotation.create = function create(properties) { + return new SafeSearchAnnotation(properties); + }; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adult != null && message.hasOwnProperty("adult")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.adult); + if (message.spoof != null && message.hasOwnProperty("spoof")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.spoof); + if (message.medical != null && message.hasOwnProperty("medical")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.medical); + if (message.violence != null && message.hasOwnProperty("violence")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.violence); + if (message.racy != null && message.hasOwnProperty("racy")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.racy); + return writer; + }; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.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.vision.v1p1beta1.SafeSearchAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.adult = reader.int32(); + break; + case 2: + message.spoof = reader.int32(); + break; + case 3: + message.medical = reader.int32(); + break; + case 4: + message.violence = reader.int32(); + break; + case 9: + message.racy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafeSearchAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafeSearchAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adult != null && message.hasOwnProperty("adult")) + switch (message.adult) { + default: + return "adult: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.spoof != null && message.hasOwnProperty("spoof")) + switch (message.spoof) { + default: + return "spoof: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.medical != null && message.hasOwnProperty("medical")) + switch (message.medical) { + default: + return "medical: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.violence != null && message.hasOwnProperty("violence")) + switch (message.violence) { + default: + return "violence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.racy != null && message.hasOwnProperty("racy")) + switch (message.racy) { + default: + return "racy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.SafeSearchAnnotation} SafeSearchAnnotation + */ + SafeSearchAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.SafeSearchAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.SafeSearchAnnotation(); + switch (object.adult) { + case "UNKNOWN": + case 0: + message.adult = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.adult = 1; + break; + case "UNLIKELY": + case 2: + message.adult = 2; + break; + case "POSSIBLE": + case 3: + message.adult = 3; + break; + case "LIKELY": + case 4: + message.adult = 4; + break; + case "VERY_LIKELY": + case 5: + message.adult = 5; + break; + } + switch (object.spoof) { + case "UNKNOWN": + case 0: + message.spoof = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.spoof = 1; + break; + case "UNLIKELY": + case 2: + message.spoof = 2; + break; + case "POSSIBLE": + case 3: + message.spoof = 3; + break; + case "LIKELY": + case 4: + message.spoof = 4; + break; + case "VERY_LIKELY": + case 5: + message.spoof = 5; + break; + } + switch (object.medical) { + case "UNKNOWN": + case 0: + message.medical = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.medical = 1; + break; + case "UNLIKELY": + case 2: + message.medical = 2; + break; + case "POSSIBLE": + case 3: + message.medical = 3; + break; + case "LIKELY": + case 4: + message.medical = 4; + break; + case "VERY_LIKELY": + case 5: + message.medical = 5; + break; + } + switch (object.violence) { + case "UNKNOWN": + case 0: + message.violence = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.violence = 1; + break; + case "UNLIKELY": + case 2: + message.violence = 2; + break; + case "POSSIBLE": + case 3: + message.violence = 3; + break; + case "LIKELY": + case 4: + message.violence = 4; + break; + case "VERY_LIKELY": + case 5: + message.violence = 5; + break; + } + switch (object.racy) { + case "UNKNOWN": + case 0: + message.racy = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.racy = 1; + break; + case "UNLIKELY": + case 2: + message.racy = 2; + break; + case "POSSIBLE": + case 3: + message.racy = 3; + break; + case "LIKELY": + case 4: + message.racy = 4; + break; + case "VERY_LIKELY": + case 5: + message.racy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.SafeSearchAnnotation} message SafeSearchAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafeSearchAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adult = options.enums === String ? "UNKNOWN" : 0; + object.spoof = options.enums === String ? "UNKNOWN" : 0; + object.medical = options.enums === String ? "UNKNOWN" : 0; + object.violence = options.enums === String ? "UNKNOWN" : 0; + object.racy = options.enums === String ? "UNKNOWN" : 0; + } + if (message.adult != null && message.hasOwnProperty("adult")) + object.adult = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.adult] : message.adult; + if (message.spoof != null && message.hasOwnProperty("spoof")) + object.spoof = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.spoof] : message.spoof; + if (message.medical != null && message.hasOwnProperty("medical")) + object.medical = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.medical] : message.medical; + if (message.violence != null && message.hasOwnProperty("violence")) + object.violence = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.violence] : message.violence; + if (message.racy != null && message.hasOwnProperty("racy")) + object.racy = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Likelihood[message.racy] : message.racy; + return object; + }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.SafeSearchAnnotation + * @instance + * @returns {Object.} JSON object + */ + SafeSearchAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SafeSearchAnnotation; + })(); + + v1p1beta1.LatLongRect = (function() { + + /** + * Properties of a LatLongRect. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ILatLongRect + * @property {google.type.ILatLng|null} [minLatLng] LatLongRect minLatLng + * @property {google.type.ILatLng|null} [maxLatLng] LatLongRect maxLatLng + */ + + /** + * Constructs a new LatLongRect. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a LatLongRect. + * @implements ILatLongRect + * @constructor + * @param {google.cloud.vision.v1p1beta1.ILatLongRect=} [properties] Properties to set + */ + function LatLongRect(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]]; + } + + /** + * LatLongRect minLatLng. + * @member {google.type.ILatLng|null|undefined} minLatLng + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.minLatLng = null; + + /** + * LatLongRect maxLatLng. + * @member {google.type.ILatLng|null|undefined} maxLatLng + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.maxLatLng = null; + + /** + * Creates a new LatLongRect instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p1beta1.ILatLongRect=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.LatLongRect} LatLongRect instance + */ + LatLongRect.create = function create(properties) { + return new LatLongRect(properties); + }; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p1beta1.LatLongRect.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p1beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + $root.google.type.LatLng.encode(message.minLatLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + $root.google.type.LatLng.encode(message.maxLatLng, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.LatLongRect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p1beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.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.vision.v1p1beta1.LatLongRect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 2: + message.maxLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLongRect message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLongRect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) { + var error = $root.google.type.LatLng.verify(message.minLatLng); + if (error) + return "minLatLng." + error; + } + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) { + var error = $root.google.type.LatLng.verify(message.maxLatLng); + if (error) + return "maxLatLng." + error; + } + return null; + }; + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.LatLongRect} LatLongRect + */ + LatLongRect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.LatLongRect) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.LatLongRect(); + if (object.minLatLng != null) { + if (typeof object.minLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.LatLongRect.minLatLng: object expected"); + message.minLatLng = $root.google.type.LatLng.fromObject(object.minLatLng); + } + if (object.maxLatLng != null) { + if (typeof object.maxLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.LatLongRect.maxLatLng: object expected"); + message.maxLatLng = $root.google.type.LatLng.fromObject(object.maxLatLng); + } + return message; + }; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p1beta1.LatLongRect} message LatLongRect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLongRect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minLatLng = null; + object.maxLatLng = null; + } + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + object.minLatLng = $root.google.type.LatLng.toObject(message.minLatLng, options); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + object.maxLatLng = $root.google.type.LatLng.toObject(message.maxLatLng, options); + return object; + }; + + /** + * Converts this LatLongRect to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.LatLongRect + * @instance + * @returns {Object.} JSON object + */ + LatLongRect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LatLongRect; + })(); + + v1p1beta1.ColorInfo = (function() { + + /** + * Properties of a ColorInfo. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IColorInfo + * @property {google.type.IColor|null} [color] ColorInfo color + * @property {number|null} [score] ColorInfo score + * @property {number|null} [pixelFraction] ColorInfo pixelFraction + */ + + /** + * Constructs a new ColorInfo. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a ColorInfo. + * @implements IColorInfo + * @constructor + * @param {google.cloud.vision.v1p1beta1.IColorInfo=} [properties] Properties to set + */ + function ColorInfo(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]]; + } + + /** + * ColorInfo color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.color = null; + + /** + * ColorInfo score. + * @member {number} score + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.score = 0; + + /** + * ColorInfo pixelFraction. + * @member {number} pixelFraction + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.pixelFraction = 0; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p1beta1.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.ColorInfo} ColorInfo instance + */ + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); + }; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ColorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p1beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.color != null && message.hasOwnProperty("color")) + $root.google.type.Color.encode(message.color, 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); + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.pixelFraction); + return writer; + }; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ColorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p1beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.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.vision.v1p1beta1.ColorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.color = $root.google.type.Color.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pixelFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColorInfo message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + if (typeof message.pixelFraction !== "number") + return "pixelFraction: number expected"; + return null; + }; + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.ColorInfo} ColorInfo + */ + ColorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.ColorInfo) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.ColorInfo(); + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.ColorInfo.color: object expected"); + message.color = $root.google.type.Color.fromObject(object.color); + } + if (object.score != null) + message.score = Number(object.score); + if (object.pixelFraction != null) + message.pixelFraction = Number(object.pixelFraction); + return message; + }; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p1beta1.ColorInfo} message ColorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.color = null; + object.score = 0; + object.pixelFraction = 0; + } + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.type.Color.toObject(message.color, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + object.pixelFraction = options.json && !isFinite(message.pixelFraction) ? String(message.pixelFraction) : message.pixelFraction; + return object; + }; + + /** + * Converts this ColorInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.ColorInfo + * @instance + * @returns {Object.} JSON object + */ + ColorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ColorInfo; + })(); + + v1p1beta1.DominantColorsAnnotation = (function() { + + /** + * Properties of a DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IDominantColorsAnnotation + * @property {Array.|null} [colors] DominantColorsAnnotation colors + */ + + /** + * Constructs a new DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a DominantColorsAnnotation. + * @implements IDominantColorsAnnotation + * @constructor + * @param {google.cloud.vision.v1p1beta1.IDominantColorsAnnotation=} [properties] Properties to set + */ + function DominantColorsAnnotation(properties) { + this.colors = []; + 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]]; + } + + /** + * DominantColorsAnnotation colors. + * @member {Array.} colors + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @instance + */ + DominantColorsAnnotation.prototype.colors = $util.emptyArray; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IDominantColorsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.DominantColorsAnnotation} DominantColorsAnnotation instance + */ + DominantColorsAnnotation.create = function create(properties) { + return new DominantColorsAnnotation(properties); + }; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.colors != null && message.colors.length) + for (var i = 0; i < message.colors.length; ++i) + $root.google.cloud.vision.v1p1beta1.ColorInfo.encode(message.colors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.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.vision.v1p1beta1.DominantColorsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.colors && message.colors.length)) + message.colors = []; + message.colors.push($root.google.cloud.vision.v1p1beta1.ColorInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominantColorsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominantColorsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.colors != null && message.hasOwnProperty("colors")) { + if (!Array.isArray(message.colors)) + return "colors: array expected"; + for (var i = 0; i < message.colors.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.ColorInfo.verify(message.colors[i]); + if (error) + return "colors." + error; + } + } + return null; + }; + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.DominantColorsAnnotation} DominantColorsAnnotation + */ + DominantColorsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.DominantColorsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.DominantColorsAnnotation(); + if (object.colors) { + if (!Array.isArray(object.colors)) + throw TypeError(".google.cloud.vision.v1p1beta1.DominantColorsAnnotation.colors: array expected"); + message.colors = []; + for (var i = 0; i < object.colors.length; ++i) { + if (typeof object.colors[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.DominantColorsAnnotation.colors: object expected"); + message.colors[i] = $root.google.cloud.vision.v1p1beta1.ColorInfo.fromObject(object.colors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.DominantColorsAnnotation} message DominantColorsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominantColorsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.colors = []; + if (message.colors && message.colors.length) { + object.colors = []; + for (var j = 0; j < message.colors.length; ++j) + object.colors[j] = $root.google.cloud.vision.v1p1beta1.ColorInfo.toObject(message.colors[j], options); + } + return object; + }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.DominantColorsAnnotation + * @instance + * @returns {Object.} JSON object + */ + DominantColorsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominantColorsAnnotation; + })(); + + v1p1beta1.ImageProperties = (function() { + + /** + * Properties of an ImageProperties. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IImageProperties + * @property {google.cloud.vision.v1p1beta1.IDominantColorsAnnotation|null} [dominantColors] ImageProperties dominantColors + */ + + /** + * Constructs a new ImageProperties. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an ImageProperties. + * @implements IImageProperties + * @constructor + * @param {google.cloud.vision.v1p1beta1.IImageProperties=} [properties] Properties to set + */ + function ImageProperties(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]]; + } + + /** + * ImageProperties dominantColors. + * @member {google.cloud.vision.v1p1beta1.IDominantColorsAnnotation|null|undefined} dominantColors + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @instance + */ + ImageProperties.prototype.dominantColors = null; + + /** + * Creates a new ImageProperties instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p1beta1.IImageProperties=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.ImageProperties} ImageProperties instance + */ + ImageProperties.create = function create(properties) { + return new ImageProperties(properties); + }; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p1beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + $root.google.cloud.vision.v1p1beta1.DominantColorsAnnotation.encode(message.dominantColors, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p1beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.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.vision.v1p1beta1.ImageProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dominantColors = $root.google.cloud.vision.v1p1beta1.DominantColorsAnnotation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageProperties message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) { + var error = $root.google.cloud.vision.v1p1beta1.DominantColorsAnnotation.verify(message.dominantColors); + if (error) + return "dominantColors." + error; + } + return null; + }; + + /** + * Creates an ImageProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.ImageProperties} ImageProperties + */ + ImageProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.ImageProperties) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.ImageProperties(); + if (object.dominantColors != null) { + if (typeof object.dominantColors !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.ImageProperties.dominantColors: object expected"); + message.dominantColors = $root.google.cloud.vision.v1p1beta1.DominantColorsAnnotation.fromObject(object.dominantColors); + } + return message; + }; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p1beta1.ImageProperties} message ImageProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dominantColors = null; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + object.dominantColors = $root.google.cloud.vision.v1p1beta1.DominantColorsAnnotation.toObject(message.dominantColors, options); + return object; + }; + + /** + * Converts this ImageProperties to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.ImageProperties + * @instance + * @returns {Object.} JSON object + */ + ImageProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageProperties; + })(); + + v1p1beta1.CropHint = (function() { + + /** + * Properties of a CropHint. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ICropHint + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [boundingPoly] CropHint boundingPoly + * @property {number|null} [confidence] CropHint confidence + * @property {number|null} [importanceFraction] CropHint importanceFraction + */ + + /** + * Constructs a new CropHint. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a CropHint. + * @implements ICropHint + * @constructor + * @param {google.cloud.vision.v1p1beta1.ICropHint=} [properties] Properties to set + */ + function CropHint(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]]; + } + + /** + * CropHint boundingPoly. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @instance + */ + CropHint.prototype.boundingPoly = null; + + /** + * CropHint confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @instance + */ + CropHint.prototype.confidence = 0; + + /** + * CropHint importanceFraction. + * @member {number} importanceFraction + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @instance + */ + CropHint.prototype.importanceFraction = 0; + + /** + * Creates a new CropHint instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHint=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.CropHint} CropHint instance + */ + CropHint.create = function create(properties) { + return new CropHint(properties); + }; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHint.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.importanceFraction); + return writer; + }; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.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.vision.v1p1beta1.CropHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.importanceFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHint message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + if (typeof message.importanceFraction !== "number") + return "importanceFraction: number expected"; + return null; + }; + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.CropHint} CropHint + */ + CropHint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.CropHint) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.CropHint(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.CropHint.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.importanceFraction != null) + message.importanceFraction = Number(object.importanceFraction); + return message; + }; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @static + * @param {google.cloud.vision.v1p1beta1.CropHint} message CropHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingPoly = null; + object.confidence = 0; + object.importanceFraction = 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + object.importanceFraction = options.json && !isFinite(message.importanceFraction) ? String(message.importanceFraction) : message.importanceFraction; + return object; + }; + + /** + * Converts this CropHint to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.CropHint + * @instance + * @returns {Object.} JSON object + */ + CropHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHint; + })(); + + v1p1beta1.CropHintsAnnotation = (function() { + + /** + * Properties of a CropHintsAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ICropHintsAnnotation + * @property {Array.|null} [cropHints] CropHintsAnnotation cropHints + */ + + /** + * Constructs a new CropHintsAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a CropHintsAnnotation. + * @implements ICropHintsAnnotation + * @constructor + * @param {google.cloud.vision.v1p1beta1.ICropHintsAnnotation=} [properties] Properties to set + */ + function CropHintsAnnotation(properties) { + this.cropHints = []; + 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]]; + } + + /** + * CropHintsAnnotation cropHints. + * @member {Array.} cropHints + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @instance + */ + CropHintsAnnotation.prototype.cropHints = $util.emptyArray; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHintsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.CropHintsAnnotation} CropHintsAnnotation instance + */ + CropHintsAnnotation.create = function create(properties) { + return new CropHintsAnnotation(properties); + }; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cropHints != null && message.cropHints.length) + for (var i = 0; i < message.cropHints.length; ++i) + $root.google.cloud.vision.v1p1beta1.CropHint.encode(message.cropHints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.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.vision.v1p1beta1.CropHintsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cropHints && message.cropHints.length)) + message.cropHints = []; + message.cropHints.push($root.google.cloud.vision.v1p1beta1.CropHint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cropHints != null && message.hasOwnProperty("cropHints")) { + if (!Array.isArray(message.cropHints)) + return "cropHints: array expected"; + for (var i = 0; i < message.cropHints.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.CropHint.verify(message.cropHints[i]); + if (error) + return "cropHints." + error; + } + } + return null; + }; + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.CropHintsAnnotation} CropHintsAnnotation + */ + CropHintsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.CropHintsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.CropHintsAnnotation(); + if (object.cropHints) { + if (!Array.isArray(object.cropHints)) + throw TypeError(".google.cloud.vision.v1p1beta1.CropHintsAnnotation.cropHints: array expected"); + message.cropHints = []; + for (var i = 0; i < object.cropHints.length; ++i) { + if (typeof object.cropHints[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.CropHintsAnnotation.cropHints: object expected"); + message.cropHints[i] = $root.google.cloud.vision.v1p1beta1.CropHint.fromObject(object.cropHints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.CropHintsAnnotation} message CropHintsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cropHints = []; + if (message.cropHints && message.cropHints.length) { + object.cropHints = []; + for (var j = 0; j < message.cropHints.length; ++j) + object.cropHints[j] = $root.google.cloud.vision.v1p1beta1.CropHint.toObject(message.cropHints[j], options); + } + return object; + }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.CropHintsAnnotation + * @instance + * @returns {Object.} JSON object + */ + CropHintsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsAnnotation; + })(); + + v1p1beta1.CropHintsParams = (function() { + + /** + * Properties of a CropHintsParams. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ICropHintsParams + * @property {Array.|null} [aspectRatios] CropHintsParams aspectRatios + */ + + /** + * Constructs a new CropHintsParams. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a CropHintsParams. + * @implements ICropHintsParams + * @constructor + * @param {google.cloud.vision.v1p1beta1.ICropHintsParams=} [properties] Properties to set + */ + function CropHintsParams(properties) { + this.aspectRatios = []; + 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]]; + } + + /** + * CropHintsParams aspectRatios. + * @member {Array.} aspectRatios + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @instance + */ + CropHintsParams.prototype.aspectRatios = $util.emptyArray; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHintsParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.CropHintsParams} CropHintsParams instance + */ + CropHintsParams.create = function create(properties) { + return new CropHintsParams(properties); + }; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aspectRatios != null && message.aspectRatios.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.aspectRatios.length; ++i) + writer.float(message.aspectRatios[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.CropHintsParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p1beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.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.vision.v1p1beta1.CropHintsParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.aspectRatios && message.aspectRatios.length)) + message.aspectRatios = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.aspectRatios.push(reader.float()); + } else + message.aspectRatios.push(reader.float()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsParams message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aspectRatios != null && message.hasOwnProperty("aspectRatios")) { + if (!Array.isArray(message.aspectRatios)) + return "aspectRatios: array expected"; + for (var i = 0; i < message.aspectRatios.length; ++i) + if (typeof message.aspectRatios[i] !== "number") + return "aspectRatios: number[] expected"; + } + return null; + }; + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.CropHintsParams} CropHintsParams + */ + CropHintsParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.CropHintsParams) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.CropHintsParams(); + if (object.aspectRatios) { + if (!Array.isArray(object.aspectRatios)) + throw TypeError(".google.cloud.vision.v1p1beta1.CropHintsParams.aspectRatios: array expected"); + message.aspectRatios = []; + for (var i = 0; i < object.aspectRatios.length; ++i) + message.aspectRatios[i] = Number(object.aspectRatios[i]); + } + return message; + }; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p1beta1.CropHintsParams} message CropHintsParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aspectRatios = []; + if (message.aspectRatios && message.aspectRatios.length) { + object.aspectRatios = []; + for (var j = 0; j < message.aspectRatios.length; ++j) + object.aspectRatios[j] = options.json && !isFinite(message.aspectRatios[j]) ? String(message.aspectRatios[j]) : message.aspectRatios[j]; + } + return object; + }; + + /** + * Converts this CropHintsParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.CropHintsParams + * @instance + * @returns {Object.} JSON object + */ + CropHintsParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsParams; + })(); + + v1p1beta1.WebDetectionParams = (function() { + + /** + * Properties of a WebDetectionParams. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IWebDetectionParams + * @property {boolean|null} [includeGeoResults] WebDetectionParams includeGeoResults + */ + + /** + * Constructs a new WebDetectionParams. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a WebDetectionParams. + * @implements IWebDetectionParams + * @constructor + * @param {google.cloud.vision.v1p1beta1.IWebDetectionParams=} [properties] Properties to set + */ + function WebDetectionParams(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]]; + } + + /** + * WebDetectionParams includeGeoResults. + * @member {boolean} includeGeoResults + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @instance + */ + WebDetectionParams.prototype.includeGeoResults = false; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p1beta1.IWebDetectionParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.WebDetectionParams} WebDetectionParams instance + */ + WebDetectionParams.create = function create(properties) { + return new WebDetectionParams(properties); + }; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p1beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeGeoResults); + return writer; + }; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p1beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.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.vision.v1p1beta1.WebDetectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.includeGeoResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetectionParams message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetectionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + if (typeof message.includeGeoResults !== "boolean") + return "includeGeoResults: boolean expected"; + return null; + }; + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.WebDetectionParams} WebDetectionParams + */ + WebDetectionParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.WebDetectionParams) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.WebDetectionParams(); + if (object.includeGeoResults != null) + message.includeGeoResults = Boolean(object.includeGeoResults); + return message; + }; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetectionParams} message WebDetectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.includeGeoResults = false; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + object.includeGeoResults = message.includeGeoResults; + return object; + }; + + /** + * Converts this WebDetectionParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.WebDetectionParams + * @instance + * @returns {Object.} JSON object + */ + WebDetectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebDetectionParams; + })(); + + v1p1beta1.ImageContext = (function() { + + /** + * Properties of an ImageContext. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IImageContext + * @property {google.cloud.vision.v1p1beta1.ILatLongRect|null} [latLongRect] ImageContext latLongRect + * @property {Array.|null} [languageHints] ImageContext languageHints + * @property {google.cloud.vision.v1p1beta1.ICropHintsParams|null} [cropHintsParams] ImageContext cropHintsParams + * @property {google.cloud.vision.v1p1beta1.IWebDetectionParams|null} [webDetectionParams] ImageContext webDetectionParams + */ + + /** + * Constructs a new ImageContext. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an ImageContext. + * @implements IImageContext + * @constructor + * @param {google.cloud.vision.v1p1beta1.IImageContext=} [properties] Properties to set + */ + function ImageContext(properties) { + this.languageHints = []; + 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]]; + } + + /** + * ImageContext latLongRect. + * @member {google.cloud.vision.v1p1beta1.ILatLongRect|null|undefined} latLongRect + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @instance + */ + ImageContext.prototype.latLongRect = null; + + /** + * ImageContext languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @instance + */ + ImageContext.prototype.languageHints = $util.emptyArray; + + /** + * ImageContext cropHintsParams. + * @member {google.cloud.vision.v1p1beta1.ICropHintsParams|null|undefined} cropHintsParams + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @instance + */ + ImageContext.prototype.cropHintsParams = null; + + /** + * ImageContext webDetectionParams. + * @member {google.cloud.vision.v1p1beta1.IWebDetectionParams|null|undefined} webDetectionParams + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @instance + */ + ImageContext.prototype.webDetectionParams = null; + + /** + * Creates a new ImageContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p1beta1.IImageContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.ImageContext} ImageContext instance + */ + ImageContext.create = function create(properties) { + return new ImageContext(properties); + }; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p1beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + $root.google.cloud.vision.v1p1beta1.LatLongRect.encode(message.latLongRect, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageHints[i]); + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + $root.google.cloud.vision.v1p1beta1.CropHintsParams.encode(message.cropHintsParams, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + $root.google.cloud.vision.v1p1beta1.WebDetectionParams.encode(message.webDetectionParams, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.ImageContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p1beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.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.vision.v1p1beta1.ImageContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLongRect = $root.google.cloud.vision.v1p1beta1.LatLongRect.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + case 4: + message.cropHintsParams = $root.google.cloud.vision.v1p1beta1.CropHintsParams.decode(reader, reader.uint32()); + break; + case 6: + message.webDetectionParams = $root.google.cloud.vision.v1p1beta1.WebDetectionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageContext message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) { + var error = $root.google.cloud.vision.v1p1beta1.LatLongRect.verify(message.latLongRect); + if (error) + return "latLongRect." + error; + } + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) { + var error = $root.google.cloud.vision.v1p1beta1.CropHintsParams.verify(message.cropHintsParams); + if (error) + return "cropHintsParams." + error; + } + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetectionParams.verify(message.webDetectionParams); + if (error) + return "webDetectionParams." + error; + } + return null; + }; + + /** + * Creates an ImageContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.ImageContext} ImageContext + */ + ImageContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.ImageContext) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.ImageContext(); + if (object.latLongRect != null) { + if (typeof object.latLongRect !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.ImageContext.latLongRect: object expected"); + message.latLongRect = $root.google.cloud.vision.v1p1beta1.LatLongRect.fromObject(object.latLongRect); + } + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.vision.v1p1beta1.ImageContext.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + if (object.cropHintsParams != null) { + if (typeof object.cropHintsParams !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.ImageContext.cropHintsParams: object expected"); + message.cropHintsParams = $root.google.cloud.vision.v1p1beta1.CropHintsParams.fromObject(object.cropHintsParams); + } + if (object.webDetectionParams != null) { + if (typeof object.webDetectionParams !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.ImageContext.webDetectionParams: object expected"); + message.webDetectionParams = $root.google.cloud.vision.v1p1beta1.WebDetectionParams.fromObject(object.webDetectionParams); + } + return message; + }; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p1beta1.ImageContext} message ImageContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (options.defaults) { + object.latLongRect = null; + object.cropHintsParams = null; + object.webDetectionParams = null; + } + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + object.latLongRect = $root.google.cloud.vision.v1p1beta1.LatLongRect.toObject(message.latLongRect, options); + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + object.cropHintsParams = $root.google.cloud.vision.v1p1beta1.CropHintsParams.toObject(message.cropHintsParams, options); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + object.webDetectionParams = $root.google.cloud.vision.v1p1beta1.WebDetectionParams.toObject(message.webDetectionParams, options); + return object; + }; + + /** + * Converts this ImageContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.ImageContext + * @instance + * @returns {Object.} JSON object + */ + ImageContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageContext; + })(); + + v1p1beta1.AnnotateImageRequest = (function() { + + /** + * Properties of an AnnotateImageRequest. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IAnnotateImageRequest + * @property {google.cloud.vision.v1p1beta1.IImage|null} [image] AnnotateImageRequest image + * @property {Array.|null} [features] AnnotateImageRequest features + * @property {google.cloud.vision.v1p1beta1.IImageContext|null} [imageContext] AnnotateImageRequest imageContext + */ + + /** + * Constructs a new AnnotateImageRequest. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an AnnotateImageRequest. + * @implements IAnnotateImageRequest + * @constructor + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageRequest=} [properties] Properties to set + */ + function AnnotateImageRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AnnotateImageRequest image. + * @member {google.cloud.vision.v1p1beta1.IImage|null|undefined} image + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.image = null; + + /** + * AnnotateImageRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateImageRequest imageContext. + * @member {google.cloud.vision.v1p1beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.imageContext = null; + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageRequest} AnnotateImageRequest instance + */ + AnnotateImageRequest.create = function create(properties) { + return new AnnotateImageRequest(properties); + }; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && message.hasOwnProperty("image")) + $root.google.cloud.vision.v1p1beta1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p1beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p1beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.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.vision.v1p1beta1.AnnotateImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = $root.google.cloud.vision.v1p1beta1.Image.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p1beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p1beta1.ImageContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.vision.v1p1beta1.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p1beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageRequest} AnnotateImageRequest + */ + AnnotateImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.AnnotateImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.AnnotateImageRequest(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageRequest.image: object expected"); + message.image = $root.google.cloud.vision.v1p1beta1.Image.fromObject(object.image); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p1beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p1beta1.ImageContext.fromObject(object.imageContext); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p1beta1.AnnotateImageRequest} message AnnotateImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.image = null; + object.imageContext = null; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.vision.v1p1beta1.Image.toObject(message.image, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p1beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p1beta1.ImageContext.toObject(message.imageContext, options); + return object; + }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageRequest; + })(); + + v1p1beta1.AnnotateImageResponse = (function() { + + /** + * Properties of an AnnotateImageResponse. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IAnnotateImageResponse + * @property {Array.|null} [faceAnnotations] AnnotateImageResponse faceAnnotations + * @property {Array.|null} [landmarkAnnotations] AnnotateImageResponse landmarkAnnotations + * @property {Array.|null} [logoAnnotations] AnnotateImageResponse logoAnnotations + * @property {Array.|null} [labelAnnotations] AnnotateImageResponse labelAnnotations + * @property {Array.|null} [textAnnotations] AnnotateImageResponse textAnnotations + * @property {google.cloud.vision.v1p1beta1.ITextAnnotation|null} [fullTextAnnotation] AnnotateImageResponse fullTextAnnotation + * @property {google.cloud.vision.v1p1beta1.ISafeSearchAnnotation|null} [safeSearchAnnotation] AnnotateImageResponse safeSearchAnnotation + * @property {google.cloud.vision.v1p1beta1.IImageProperties|null} [imagePropertiesAnnotation] AnnotateImageResponse imagePropertiesAnnotation + * @property {google.cloud.vision.v1p1beta1.ICropHintsAnnotation|null} [cropHintsAnnotation] AnnotateImageResponse cropHintsAnnotation + * @property {google.cloud.vision.v1p1beta1.IWebDetection|null} [webDetection] AnnotateImageResponse webDetection + * @property {google.rpc.IStatus|null} [error] AnnotateImageResponse error + */ + + /** + * Constructs a new AnnotateImageResponse. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents an AnnotateImageResponse. + * @implements IAnnotateImageResponse + * @constructor + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageResponse=} [properties] Properties to set + */ + function AnnotateImageResponse(properties) { + this.faceAnnotations = []; + this.landmarkAnnotations = []; + this.logoAnnotations = []; + this.labelAnnotations = []; + this.textAnnotations = []; + 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]]; + } + + /** + * AnnotateImageResponse faceAnnotations. + * @member {Array.} faceAnnotations + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.faceAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse landmarkAnnotations. + * @member {Array.} landmarkAnnotations + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.landmarkAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse logoAnnotations. + * @member {Array.} logoAnnotations + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.logoAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse labelAnnotations. + * @member {Array.} labelAnnotations + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.labelAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.textAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse fullTextAnnotation. + * @member {google.cloud.vision.v1p1beta1.ITextAnnotation|null|undefined} fullTextAnnotation + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.fullTextAnnotation = null; + + /** + * AnnotateImageResponse safeSearchAnnotation. + * @member {google.cloud.vision.v1p1beta1.ISafeSearchAnnotation|null|undefined} safeSearchAnnotation + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.safeSearchAnnotation = null; + + /** + * AnnotateImageResponse imagePropertiesAnnotation. + * @member {google.cloud.vision.v1p1beta1.IImageProperties|null|undefined} imagePropertiesAnnotation + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.imagePropertiesAnnotation = null; + + /** + * AnnotateImageResponse cropHintsAnnotation. + * @member {google.cloud.vision.v1p1beta1.ICropHintsAnnotation|null|undefined} cropHintsAnnotation + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.cropHintsAnnotation = null; + + /** + * AnnotateImageResponse webDetection. + * @member {google.cloud.vision.v1p1beta1.IWebDetection|null|undefined} webDetection + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.webDetection = null; + + /** + * AnnotateImageResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.error = null; + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageResponse} AnnotateImageResponse instance + */ + AnnotateImageResponse.create = function create(properties) { + return new AnnotateImageResponse(properties); + }; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faceAnnotations != null && message.faceAnnotations.length) + for (var i = 0; i < message.faceAnnotations.length; ++i) + $root.google.cloud.vision.v1p1beta1.FaceAnnotation.encode(message.faceAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.landmarkAnnotations != null && message.landmarkAnnotations.length) + for (var i = 0; i < message.landmarkAnnotations.length; ++i) + $root.google.cloud.vision.v1p1beta1.EntityAnnotation.encode(message.landmarkAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.logoAnnotations != null && message.logoAnnotations.length) + for (var i = 0; i < message.logoAnnotations.length; ++i) + $root.google.cloud.vision.v1p1beta1.EntityAnnotation.encode(message.logoAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labelAnnotations != null && message.labelAnnotations.length) + for (var i = 0; i < message.labelAnnotations.length; ++i) + $root.google.cloud.vision.v1p1beta1.EntityAnnotation.encode(message.labelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.vision.v1p1beta1.EntityAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + $root.google.cloud.vision.v1p1beta1.SafeSearchAnnotation.encode(message.safeSearchAnnotation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + $root.google.cloud.vision.v1p1beta1.ImageProperties.encode(message.imagePropertiesAnnotation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + $root.google.cloud.vision.v1p1beta1.CropHintsAnnotation.encode(message.cropHintsAnnotation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.encode(message.fullTextAnnotation, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + $root.google.cloud.vision.v1p1beta1.WebDetection.encode(message.webDetection, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.AnnotateImageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p1beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.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.vision.v1p1beta1.AnnotateImageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.faceAnnotations && message.faceAnnotations.length)) + message.faceAnnotations = []; + message.faceAnnotations.push($root.google.cloud.vision.v1p1beta1.FaceAnnotation.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.landmarkAnnotations && message.landmarkAnnotations.length)) + message.landmarkAnnotations = []; + message.landmarkAnnotations.push($root.google.cloud.vision.v1p1beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.logoAnnotations && message.logoAnnotations.length)) + message.logoAnnotations = []; + message.logoAnnotations.push($root.google.cloud.vision.v1p1beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.labelAnnotations && message.labelAnnotations.length)) + message.labelAnnotations = []; + message.labelAnnotations.push($root.google.cloud.vision.v1p1beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.vision.v1p1beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 12: + message.fullTextAnnotation = $root.google.cloud.vision.v1p1beta1.TextAnnotation.decode(reader, reader.uint32()); + break; + case 6: + message.safeSearchAnnotation = $root.google.cloud.vision.v1p1beta1.SafeSearchAnnotation.decode(reader, reader.uint32()); + break; + case 8: + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p1beta1.ImageProperties.decode(reader, reader.uint32()); + break; + case 11: + message.cropHintsAnnotation = $root.google.cloud.vision.v1p1beta1.CropHintsAnnotation.decode(reader, reader.uint32()); + break; + case 13: + message.webDetection = $root.google.cloud.vision.v1p1beta1.WebDetection.decode(reader, reader.uint32()); + break; + case 9: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageResponse message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faceAnnotations != null && message.hasOwnProperty("faceAnnotations")) { + if (!Array.isArray(message.faceAnnotations)) + return "faceAnnotations: array expected"; + for (var i = 0; i < message.faceAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.FaceAnnotation.verify(message.faceAnnotations[i]); + if (error) + return "faceAnnotations." + error; + } + } + if (message.landmarkAnnotations != null && message.hasOwnProperty("landmarkAnnotations")) { + if (!Array.isArray(message.landmarkAnnotations)) + return "landmarkAnnotations: array expected"; + for (var i = 0; i < message.landmarkAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.verify(message.landmarkAnnotations[i]); + if (error) + return "landmarkAnnotations." + error; + } + } + if (message.logoAnnotations != null && message.hasOwnProperty("logoAnnotations")) { + if (!Array.isArray(message.logoAnnotations)) + return "logoAnnotations: array expected"; + for (var i = 0; i < message.logoAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.verify(message.logoAnnotations[i]); + if (error) + return "logoAnnotations." + error; + } + } + if (message.labelAnnotations != null && message.hasOwnProperty("labelAnnotations")) { + if (!Array.isArray(message.labelAnnotations)) + return "labelAnnotations: array expected"; + for (var i = 0; i < message.labelAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.verify(message.labelAnnotations[i]); + if (error) + return "labelAnnotations." + error; + } + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.verify(message.fullTextAnnotation); + if (error) + return "fullTextAnnotation." + error; + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) { + var error = $root.google.cloud.vision.v1p1beta1.SafeSearchAnnotation.verify(message.safeSearchAnnotation); + if (error) + return "safeSearchAnnotation." + error; + } + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) { + var error = $root.google.cloud.vision.v1p1beta1.ImageProperties.verify(message.imagePropertiesAnnotation); + if (error) + return "imagePropertiesAnnotation." + error; + } + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) { + var error = $root.google.cloud.vision.v1p1beta1.CropHintsAnnotation.verify(message.cropHintsAnnotation); + if (error) + return "cropHintsAnnotation." + error; + } + if (message.webDetection != null && message.hasOwnProperty("webDetection")) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.verify(message.webDetection); + if (error) + return "webDetection." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.AnnotateImageResponse} AnnotateImageResponse + */ + AnnotateImageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.AnnotateImageResponse) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.AnnotateImageResponse(); + if (object.faceAnnotations) { + if (!Array.isArray(object.faceAnnotations)) + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.faceAnnotations: array expected"); + message.faceAnnotations = []; + for (var i = 0; i < object.faceAnnotations.length; ++i) { + if (typeof object.faceAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.faceAnnotations: object expected"); + message.faceAnnotations[i] = $root.google.cloud.vision.v1p1beta1.FaceAnnotation.fromObject(object.faceAnnotations[i]); + } + } + if (object.landmarkAnnotations) { + if (!Array.isArray(object.landmarkAnnotations)) + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.landmarkAnnotations: array expected"); + message.landmarkAnnotations = []; + for (var i = 0; i < object.landmarkAnnotations.length; ++i) { + if (typeof object.landmarkAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.landmarkAnnotations: object expected"); + message.landmarkAnnotations[i] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.fromObject(object.landmarkAnnotations[i]); + } + } + if (object.logoAnnotations) { + if (!Array.isArray(object.logoAnnotations)) + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.logoAnnotations: array expected"); + message.logoAnnotations = []; + for (var i = 0; i < object.logoAnnotations.length; ++i) { + if (typeof object.logoAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.logoAnnotations: object expected"); + message.logoAnnotations[i] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.fromObject(object.logoAnnotations[i]); + } + } + if (object.labelAnnotations) { + if (!Array.isArray(object.labelAnnotations)) + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.labelAnnotations: array expected"); + message.labelAnnotations = []; + for (var i = 0; i < object.labelAnnotations.length; ++i) { + if (typeof object.labelAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.labelAnnotations: object expected"); + message.labelAnnotations[i] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.fromObject(object.labelAnnotations[i]); + } + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.fullTextAnnotation != null) { + if (typeof object.fullTextAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.fullTextAnnotation: object expected"); + message.fullTextAnnotation = $root.google.cloud.vision.v1p1beta1.TextAnnotation.fromObject(object.fullTextAnnotation); + } + if (object.safeSearchAnnotation != null) { + if (typeof object.safeSearchAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.safeSearchAnnotation: object expected"); + message.safeSearchAnnotation = $root.google.cloud.vision.v1p1beta1.SafeSearchAnnotation.fromObject(object.safeSearchAnnotation); + } + if (object.imagePropertiesAnnotation != null) { + if (typeof object.imagePropertiesAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.imagePropertiesAnnotation: object expected"); + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p1beta1.ImageProperties.fromObject(object.imagePropertiesAnnotation); + } + if (object.cropHintsAnnotation != null) { + if (typeof object.cropHintsAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.cropHintsAnnotation: object expected"); + message.cropHintsAnnotation = $root.google.cloud.vision.v1p1beta1.CropHintsAnnotation.fromObject(object.cropHintsAnnotation); + } + if (object.webDetection != null) { + if (typeof object.webDetection !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.webDetection: object expected"); + message.webDetection = $root.google.cloud.vision.v1p1beta1.WebDetection.fromObject(object.webDetection); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.AnnotateImageResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p1beta1.AnnotateImageResponse} message AnnotateImageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.faceAnnotations = []; + object.landmarkAnnotations = []; + object.logoAnnotations = []; + object.labelAnnotations = []; + object.textAnnotations = []; + } + if (options.defaults) { + object.safeSearchAnnotation = null; + object.imagePropertiesAnnotation = null; + object.error = null; + object.cropHintsAnnotation = null; + object.fullTextAnnotation = null; + object.webDetection = null; + } + if (message.faceAnnotations && message.faceAnnotations.length) { + object.faceAnnotations = []; + for (var j = 0; j < message.faceAnnotations.length; ++j) + object.faceAnnotations[j] = $root.google.cloud.vision.v1p1beta1.FaceAnnotation.toObject(message.faceAnnotations[j], options); + } + if (message.landmarkAnnotations && message.landmarkAnnotations.length) { + object.landmarkAnnotations = []; + for (var j = 0; j < message.landmarkAnnotations.length; ++j) + object.landmarkAnnotations[j] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.toObject(message.landmarkAnnotations[j], options); + } + if (message.logoAnnotations && message.logoAnnotations.length) { + object.logoAnnotations = []; + for (var j = 0; j < message.logoAnnotations.length; ++j) + object.logoAnnotations[j] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.toObject(message.logoAnnotations[j], options); + } + if (message.labelAnnotations && message.labelAnnotations.length) { + object.labelAnnotations = []; + for (var j = 0; j < message.labelAnnotations.length; ++j) + object.labelAnnotations[j] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.toObject(message.labelAnnotations[j], options); + } + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.vision.v1p1beta1.EntityAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + object.safeSearchAnnotation = $root.google.cloud.vision.v1p1beta1.SafeSearchAnnotation.toObject(message.safeSearchAnnotation, options); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + object.imagePropertiesAnnotation = $root.google.cloud.vision.v1p1beta1.ImageProperties.toObject(message.imagePropertiesAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + object.cropHintsAnnotation = $root.google.cloud.vision.v1p1beta1.CropHintsAnnotation.toObject(message.cropHintsAnnotation, options); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + object.fullTextAnnotation = $root.google.cloud.vision.v1p1beta1.TextAnnotation.toObject(message.fullTextAnnotation, options); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + object.webDetection = $root.google.cloud.vision.v1p1beta1.WebDetection.toObject(message.webDetection, options); + return object; + }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.AnnotateImageResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageResponse; + })(); + + v1p1beta1.BatchAnnotateImagesRequest = (function() { + + /** + * Properties of a BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IBatchAnnotateImagesRequest + * @property {Array.|null} [requests] BatchAnnotateImagesRequest requests + */ + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a BatchAnnotateImagesRequest. + * @implements IBatchAnnotateImagesRequest + * @constructor + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + */ + function BatchAnnotateImagesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchAnnotateImagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @instance + */ + BatchAnnotateImagesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest instance + */ + BatchAnnotateImagesRequest.create = function create(properties) { + return new BatchAnnotateImagesRequest(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p1beta1.AnnotateImageRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.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.vision.v1p1beta1.BatchAnnotateImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p1beta1.AnnotateImageRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.AnnotateImageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + */ + BatchAnnotateImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p1beta1.AnnotateImageRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest} message BatchAnnotateImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p1beta1.AnnotateImageRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesRequest; + })(); + + v1p1beta1.BatchAnnotateImagesResponse = (function() { + + /** + * Properties of a BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IBatchAnnotateImagesResponse + * @property {Array.|null} [responses] BatchAnnotateImagesResponse responses + */ + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a BatchAnnotateImagesResponse. + * @implements IBatchAnnotateImagesResponse + * @constructor + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + */ + function BatchAnnotateImagesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * BatchAnnotateImagesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @instance + */ + BatchAnnotateImagesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse instance + */ + BatchAnnotateImagesResponse.create = function create(properties) { + return new BatchAnnotateImagesResponse(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p1beta1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p1beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.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.vision.v1p1beta1.BatchAnnotateImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p1beta1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + */ + BatchAnnotateImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p1beta1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse} message BatchAnnotateImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p1beta1.AnnotateImageResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesResponse; + })(); + + /** + * Likelihood enum. + * @name google.cloud.vision.v1p1beta1.Likelihood + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1p1beta1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + v1p1beta1.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.vision.v1p1beta1.IVertex=} [properties] Properties to set + */ + function Vertex(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]]; + } + + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {google.cloud.vision.v1p1beta1.IVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {google.cloud.vision.v1p1beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && message.hasOwnProperty("x")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); + if (message.y != null && message.hasOwnProperty("y")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); + return writer; + }; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {google.cloud.vision.v1p1beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.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.vision.v1p1beta1.Vertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.int32(); + break; + case 2: + message.y = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vertex message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Vertex) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Vertex(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @static + * @param {google.cloud.vision.v1p1beta1.Vertex} message Vertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vertex.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 = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + + /** + * Converts this Vertex to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Vertex + * @instance + * @returns {Object.} JSON object + */ + Vertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vertex; + })(); + + v1p1beta1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.vision.v1p1beta1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.vertices = []; + 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 vertices. + * @member {Array.} vertices + * @memberof google.cloud.vision.v1p1beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p1beta1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p1beta1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p1beta1.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.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.vision.v1p1beta1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.vision.v1p1beta1.Vertex.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.vision.v1p1beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.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.vision.v1p1beta1.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.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.BoundingPoly) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.vision.v1p1beta1.BoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.vision.v1p1beta1.Vertex.fromObject(object.vertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p1beta1.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.vertices = []; + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.vision.v1p1beta1.Vertex.toObject(message.vertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoundingPoly; + })(); + + v1p1beta1.Position = (function() { + + /** + * Properties of a Position. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IPosition + * @property {number|null} [x] Position x + * @property {number|null} [y] Position y + * @property {number|null} [z] Position z + */ + + /** + * Constructs a new Position. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Position. + * @implements IPosition + * @constructor + * @param {google.cloud.vision.v1p1beta1.IPosition=} [properties] Properties to set + */ + function Position(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]]; + } + + /** + * Position x. + * @member {number} x + * @memberof google.cloud.vision.v1p1beta1.Position + * @instance + */ + Position.prototype.x = 0; + + /** + * Position y. + * @member {number} y + * @memberof google.cloud.vision.v1p1beta1.Position + * @instance + */ + Position.prototype.y = 0; + + /** + * Position z. + * @member {number} z + * @memberof google.cloud.vision.v1p1beta1.Position + * @instance + */ + Position.prototype.z = 0; + + /** + * Creates a new Position instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {google.cloud.vision.v1p1beta1.IPosition=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Position} Position instance + */ + Position.create = function create(properties) { + return new Position(properties); + }; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Position.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {google.cloud.vision.v1p1beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.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); + if (message.z != null && message.hasOwnProperty("z")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.z); + return writer; + }; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Position.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {google.cloud.vision.v1p1beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Position message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.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.vision.v1p1beta1.Position(); + 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; + case 3: + message.z = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Position message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Position.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"; + if (message.z != null && message.hasOwnProperty("z")) + if (typeof message.z !== "number") + return "z: number expected"; + return null; + }; + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Position} Position + */ + Position.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Position) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Position(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + if (object.z != null) + message.z = Number(object.z); + return message; + }; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Position + * @static + * @param {google.cloud.vision.v1p1beta1.Position} message Position + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Position.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + object.z = 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; + if (message.z != null && message.hasOwnProperty("z")) + object.z = options.json && !isFinite(message.z) ? String(message.z) : message.z; + return object; + }; + + /** + * Converts this Position to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Position + * @instance + * @returns {Object.} JSON object + */ + Position.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Position; + })(); + + v1p1beta1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ITextAnnotation + * @property {Array.|null} [pages] TextAnnotation pages + * @property {string|null} [text] TextAnnotation text + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.vision.v1p1beta1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.pages = []; + 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]]; + } + + /** + * TextAnnotation pages. + * @member {Array.} pages + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.pages = $util.emptyArray; + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.vision.v1p1beta1.Page.encode(message.pages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.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.vision.v1p1beta1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.vision.v1p1beta1.Page.decode(reader, reader.uint32())); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Page.verify(message.pages[i]); + if (error) + return "pages." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.TextAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.TextAnnotation(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.vision.v1p1beta1.TextAnnotation.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.TextAnnotation.pages: object expected"); + message.pages[i] = $root.google.cloud.vision.v1p1beta1.Page.fromObject(object.pages[i]); + } + } + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (options.defaults) + object.text = ""; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.vision.v1p1beta1.Page.toObject(message.pages[j], options); + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TextAnnotation.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(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]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.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.vision.v1p1beta1.TextAnnotation.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectedLanguage; + })(); + + TextAnnotation.DetectedBreak = (function() { + + /** + * Properties of a DetectedBreak. + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @interface IDetectedBreak + * @property {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType|null} [type] DetectedBreak type + * @property {boolean|null} [isPrefix] DetectedBreak isPrefix + */ + + /** + * Constructs a new DetectedBreak. + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @classdesc Represents a DetectedBreak. + * @implements IDetectedBreak + * @constructor + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + */ + function DetectedBreak(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]]; + } + + /** + * DetectedBreak type. + * @member {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType} type + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.type = 0; + + /** + * DetectedBreak isPrefix. + * @member {boolean} isPrefix + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.isPrefix = false; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak} DetectedBreak instance + */ + DetectedBreak.create = function create(properties) { + return new DetectedBreak(properties); + }; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isPrefix); + return writer; + }; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.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.vision.v1p1beta1.TextAnnotation.DetectedBreak(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.isPrefix = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedBreak message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedBreak.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + if (typeof message.isPrefix !== "boolean") + return "isPrefix: boolean expected"; + return null; + }; + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak} DetectedBreak + */ + DetectedBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "SPACE": + case 1: + message.type = 1; + break; + case "SURE_SPACE": + case 2: + message.type = 2; + break; + case "EOL_SURE_SPACE": + case 3: + message.type = 3; + break; + case "HYPHEN": + case 4: + message.type = 4; + break; + case "LINE_BREAK": + case 5: + message.type = 5; + break; + } + if (object.isPrefix != null) + message.isPrefix = Boolean(object.isPrefix); + return message; + }; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak} message DetectedBreak + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedBreak.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.isPrefix = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType[message.type] : message.type; + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + object.isPrefix = message.isPrefix; + return object; + }; + + /** + * Converts this DetectedBreak to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak + * @instance + * @returns {Object.} JSON object + */ + DetectedBreak.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BreakType enum. + * @name google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SPACE=1 SPACE value + * @property {number} SURE_SPACE=2 SURE_SPACE value + * @property {number} EOL_SURE_SPACE=3 EOL_SURE_SPACE value + * @property {number} HYPHEN=4 HYPHEN value + * @property {number} LINE_BREAK=5 LINE_BREAK value + */ + DetectedBreak.BreakType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SPACE"] = 1; + values[valuesById[2] = "SURE_SPACE"] = 2; + values[valuesById[3] = "EOL_SURE_SPACE"] = 3; + values[valuesById[4] = "HYPHEN"] = 4; + values[valuesById[5] = "LINE_BREAK"] = 5; + return values; + })(); + + return DetectedBreak; + })(); + + TextAnnotation.TextProperty = (function() { + + /** + * Properties of a TextProperty. + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @interface ITextProperty + * @property {Array.|null} [detectedLanguages] TextProperty detectedLanguages + * @property {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak|null} [detectedBreak] TextProperty detectedBreak + */ + + /** + * Constructs a new TextProperty. + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation + * @classdesc Represents a TextProperty. + * @implements ITextProperty + * @constructor + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + */ + function TextProperty(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * TextProperty detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedLanguages = $util.emptyArray; + + /** + * TextProperty detectedBreak. + * @member {google.cloud.vision.v1p1beta1.TextAnnotation.IDetectedBreak|null|undefined} detectedBreak + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedBreak = null; + + /** + * Creates a new TextProperty instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty} TextProperty instance + */ + TextProperty.create = function create(properties) { + return new TextProperty(properties); + }; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.encode(message.detectedBreak, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.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.vision.v1p1beta1.TextAnnotation.TextProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.decode(reader, reader.uint32())); + break; + case 2: + message.detectedBreak = $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProperty message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.verify(message.detectedBreak); + if (error) + return "detectedBreak." + error; + } + return null; + }; + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty} TextProperty + */ + TextProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty(); + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.detectedBreak != null) { + if (typeof object.detectedBreak !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.detectedBreak: object expected"); + message.detectedBreak = $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.fromObject(object.detectedBreak); + } + return message; + }; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty} message TextProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) + object.detectedBreak = null; + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + object.detectedBreak = $root.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.toObject(message.detectedBreak, options); + return object; + }; + + /** + * Converts this TextProperty to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty + * @instance + * @returns {Object.} JSON object + */ + TextProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProperty; + })(); + + return TextAnnotation; + })(); + + v1p1beta1.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IPage + * @property {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null} [property] Page property + * @property {number|null} [width] Page width + * @property {number|null} [height] Page height + * @property {Array.|null} [blocks] Page blocks + * @property {number|null} [confidence] Page confidence + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.vision.v1p1beta1.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.blocks = []; + 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]]; + } + + /** + * Page property. + * @member {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p1beta1.Page + * @instance + */ + Page.prototype.property = null; + + /** + * Page width. + * @member {number} width + * @memberof google.cloud.vision.v1p1beta1.Page + * @instance + */ + Page.prototype.width = 0; + + /** + * Page height. + * @member {number} height + * @memberof google.cloud.vision.v1p1beta1.Page + * @instance + */ + Page.prototype.height = 0; + + /** + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.vision.v1p1beta1.Page + * @instance + */ + Page.prototype.blocks = $util.emptyArray; + + /** + * Page confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.Page + * @instance + */ + Page.prototype.confidence = 0; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {google.cloud.vision.v1p1beta1.IPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {google.cloud.vision.v1p1beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.width != null && message.hasOwnProperty("width")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.width); + if (message.height != null && message.hasOwnProperty("height")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.height); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.vision.v1p1beta1.Block.encode(message.blocks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {google.cloud.vision.v1p1beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.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.vision.v1p1beta1.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.width = reader.int32(); + break; + case 3: + message.height = reader.int32(); + break; + case 4: + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.vision.v1p1beta1.Block.decode(reader, reader.uint32())); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Block.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Page) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Page(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Page.property: object expected"); + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.vision.v1p1beta1.Page.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Page.blocks: object expected"); + message.blocks[i] = $root.google.cloud.vision.v1p1beta1.Block.fromObject(object.blocks[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Page + * @static + * @param {google.cloud.vision.v1p1beta1.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (options.defaults) { + object.property = null; + object.width = 0; + object.height = 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.vision.v1p1beta1.Block.toObject(message.blocks[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Page; + })(); + + v1p1beta1.Block = (function() { + + /** + * Properties of a Block. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IBlock + * @property {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null} [property] Block property + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [boundingBox] Block boundingBox + * @property {Array.|null} [paragraphs] Block paragraphs + * @property {google.cloud.vision.v1p1beta1.Block.BlockType|null} [blockType] Block blockType + * @property {number|null} [confidence] Block confidence + */ + + /** + * Constructs a new Block. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {google.cloud.vision.v1p1beta1.IBlock=} [properties] Properties to set + */ + function Block(properties) { + this.paragraphs = []; + 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]]; + } + + /** + * Block property. + * @member {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p1beta1.Block + * @instance + */ + Block.prototype.property = null; + + /** + * Block boundingBox. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p1beta1.Block + * @instance + */ + Block.prototype.boundingBox = null; + + /** + * Block paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.vision.v1p1beta1.Block + * @instance + */ + Block.prototype.paragraphs = $util.emptyArray; + + /** + * Block blockType. + * @member {google.cloud.vision.v1p1beta1.Block.BlockType} blockType + * @memberof google.cloud.vision.v1p1beta1.Block + * @instance + */ + Block.prototype.blockType = 0; + + /** + * Block confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.Block + * @instance + */ + Block.prototype.confidence = 0; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {google.cloud.vision.v1p1beta1.IBlock=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Block.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {google.cloud.vision.v1p1beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paragraphs != null && message.paragraphs.length) + for (var i = 0; i < message.paragraphs.length; ++i) + $root.google.cloud.vision.v1p1beta1.Paragraph.encode(message.paragraphs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.blockType != null && message.hasOwnProperty("blockType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.blockType); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {google.cloud.vision.v1p1beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.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.vision.v1p1beta1.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.paragraphs && message.paragraphs.length)) + message.paragraphs = []; + message.paragraphs.push($root.google.cloud.vision.v1p1beta1.Paragraph.decode(reader, reader.uint32())); + break; + case 4: + message.blockType = reader.int32(); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.paragraphs != null && message.hasOwnProperty("paragraphs")) { + if (!Array.isArray(message.paragraphs)) + return "paragraphs: array expected"; + for (var i = 0; i < message.paragraphs.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Paragraph.verify(message.paragraphs[i]); + if (error) + return "paragraphs." + error; + } + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + switch (message.blockType) { + default: + return "blockType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Block) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Block(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Block.property: object expected"); + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Block.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.paragraphs) { + if (!Array.isArray(object.paragraphs)) + throw TypeError(".google.cloud.vision.v1p1beta1.Block.paragraphs: array expected"); + message.paragraphs = []; + for (var i = 0; i < object.paragraphs.length; ++i) { + if (typeof object.paragraphs[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Block.paragraphs: object expected"); + message.paragraphs[i] = $root.google.cloud.vision.v1p1beta1.Paragraph.fromObject(object.paragraphs[i]); + } + } + switch (object.blockType) { + case "UNKNOWN": + case 0: + message.blockType = 0; + break; + case "TEXT": + case 1: + message.blockType = 1; + break; + case "TABLE": + case 2: + message.blockType = 2; + break; + case "PICTURE": + case 3: + message.blockType = 3; + break; + case "RULER": + case 4: + message.blockType = 4; + break; + case "BARCODE": + case 5: + message.blockType = 5; + break; + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Block + * @static + * @param {google.cloud.vision.v1p1beta1.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paragraphs = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.blockType = options.enums === String ? "UNKNOWN" : 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.paragraphs && message.paragraphs.length) { + object.paragraphs = []; + for (var j = 0; j < message.paragraphs.length; ++j) + object.paragraphs[j] = $root.google.cloud.vision.v1p1beta1.Paragraph.toObject(message.paragraphs[j], options); + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + object.blockType = options.enums === String ? $root.google.cloud.vision.v1p1beta1.Block.BlockType[message.blockType] : message.blockType; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BlockType enum. + * @name google.cloud.vision.v1p1beta1.Block.BlockType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} TEXT=1 TEXT value + * @property {number} TABLE=2 TABLE value + * @property {number} PICTURE=3 PICTURE value + * @property {number} RULER=4 RULER value + * @property {number} BARCODE=5 BARCODE value + */ + Block.BlockType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "TABLE"] = 2; + values[valuesById[3] = "PICTURE"] = 3; + values[valuesById[4] = "RULER"] = 4; + values[valuesById[5] = "BARCODE"] = 5; + return values; + })(); + + return Block; + })(); + + v1p1beta1.Paragraph = (function() { + + /** + * Properties of a Paragraph. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IParagraph + * @property {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null} [property] Paragraph property + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [boundingBox] Paragraph boundingBox + * @property {Array.|null} [words] Paragraph words + * @property {number|null} [confidence] Paragraph confidence + */ + + /** + * Constructs a new Paragraph. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Paragraph. + * @implements IParagraph + * @constructor + * @param {google.cloud.vision.v1p1beta1.IParagraph=} [properties] Properties to set + */ + function Paragraph(properties) { + this.words = []; + 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]]; + } + + /** + * Paragraph property. + * @member {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @instance + */ + Paragraph.prototype.property = null; + + /** + * Paragraph boundingBox. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @instance + */ + Paragraph.prototype.boundingBox = null; + + /** + * Paragraph words. + * @member {Array.} words + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @instance + */ + Paragraph.prototype.words = $util.emptyArray; + + /** + * Paragraph confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @instance + */ + Paragraph.prototype.confidence = 0; + + /** + * Creates a new Paragraph instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p1beta1.IParagraph=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Paragraph} Paragraph instance + */ + Paragraph.create = function create(properties) { + return new Paragraph(properties); + }; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Paragraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p1beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.vision.v1p1beta1.Word.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Paragraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p1beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.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.vision.v1p1beta1.Paragraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.vision.v1p1beta1.Word.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Paragraph message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Paragraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Word.verify(message.words[i]); + if (error) + return "words." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Paragraph} Paragraph + */ + Paragraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Paragraph) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Paragraph(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Paragraph.property: object expected"); + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Paragraph.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.vision.v1p1beta1.Paragraph.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Paragraph.words: object expected"); + message.words[i] = $root.google.cloud.vision.v1p1beta1.Word.fromObject(object.words[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p1beta1.Paragraph} message Paragraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Paragraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.vision.v1p1beta1.Word.toObject(message.words[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Paragraph to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Paragraph + * @instance + * @returns {Object.} JSON object + */ + Paragraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Paragraph; + })(); + + v1p1beta1.Word = (function() { + + /** + * Properties of a Word. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IWord + * @property {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null} [property] Word property + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [boundingBox] Word boundingBox + * @property {Array.|null} [symbols] Word symbols + * @property {number|null} [confidence] Word confidence + */ + + /** + * Constructs a new Word. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Word. + * @implements IWord + * @constructor + * @param {google.cloud.vision.v1p1beta1.IWord=} [properties] Properties to set + */ + function Word(properties) { + this.symbols = []; + 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]]; + } + + /** + * Word property. + * @member {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p1beta1.Word + * @instance + */ + Word.prototype.property = null; + + /** + * Word boundingBox. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p1beta1.Word + * @instance + */ + Word.prototype.boundingBox = null; + + /** + * Word symbols. + * @member {Array.} symbols + * @memberof google.cloud.vision.v1p1beta1.Word + * @instance + */ + Word.prototype.symbols = $util.emptyArray; + + /** + * Word confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.Word + * @instance + */ + Word.prototype.confidence = 0; + + /** + * Creates a new Word instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {google.cloud.vision.v1p1beta1.IWord=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Word} Word instance + */ + Word.create = function create(properties) { + return new Word(properties); + }; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Word.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {google.cloud.vision.v1p1beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.symbols != null && message.symbols.length) + for (var i = 0; i < message.symbols.length; ++i) + $root.google.cloud.vision.v1p1beta1.Symbol.encode(message.symbols[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Word.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {google.cloud.vision.v1p1beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Word message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.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.vision.v1p1beta1.Word(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.symbols && message.symbols.length)) + message.symbols = []; + message.symbols.push($root.google.cloud.vision.v1p1beta1.Symbol.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Word message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Word.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.symbols != null && message.hasOwnProperty("symbols")) { + if (!Array.isArray(message.symbols)) + return "symbols: array expected"; + for (var i = 0; i < message.symbols.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.Symbol.verify(message.symbols[i]); + if (error) + return "symbols." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Word} Word + */ + Word.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Word) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Word(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Word.property: object expected"); + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Word.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.symbols) { + if (!Array.isArray(object.symbols)) + throw TypeError(".google.cloud.vision.v1p1beta1.Word.symbols: array expected"); + message.symbols = []; + for (var i = 0; i < object.symbols.length; ++i) { + if (typeof object.symbols[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Word.symbols: object expected"); + message.symbols[i] = $root.google.cloud.vision.v1p1beta1.Symbol.fromObject(object.symbols[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Word + * @static + * @param {google.cloud.vision.v1p1beta1.Word} message Word + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Word.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.symbols = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.symbols && message.symbols.length) { + object.symbols = []; + for (var j = 0; j < message.symbols.length; ++j) + object.symbols[j] = $root.google.cloud.vision.v1p1beta1.Symbol.toObject(message.symbols[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Word to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Word + * @instance + * @returns {Object.} JSON object + */ + Word.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Word; + })(); + + v1p1beta1.Symbol = (function() { + + /** + * Properties of a Symbol. + * @memberof google.cloud.vision.v1p1beta1 + * @interface ISymbol + * @property {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null} [property] Symbol property + * @property {google.cloud.vision.v1p1beta1.IBoundingPoly|null} [boundingBox] Symbol boundingBox + * @property {string|null} [text] Symbol text + * @property {number|null} [confidence] Symbol confidence + */ + + /** + * Constructs a new Symbol. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a Symbol. + * @implements ISymbol + * @constructor + * @param {google.cloud.vision.v1p1beta1.ISymbol=} [properties] Properties to set + */ + function Symbol(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]]; + } + + /** + * Symbol property. + * @member {google.cloud.vision.v1p1beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @instance + */ + Symbol.prototype.property = null; + + /** + * Symbol boundingBox. + * @member {google.cloud.vision.v1p1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @instance + */ + Symbol.prototype.boundingBox = null; + + /** + * Symbol text. + * @member {string} text + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @instance + */ + Symbol.prototype.text = ""; + + /** + * Symbol confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @instance + */ + Symbol.prototype.confidence = 0; + + /** + * Creates a new Symbol instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {google.cloud.vision.v1p1beta1.ISymbol=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.Symbol} Symbol instance + */ + Symbol.create = function create(properties) { + return new Symbol(properties); + }; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p1beta1.Symbol.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {google.cloud.vision.v1p1beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.Symbol.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {google.cloud.vision.v1p1beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.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.vision.v1p1beta1.Symbol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + message.text = reader.string(); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Symbol message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Symbol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.Symbol} Symbol + */ + Symbol.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.Symbol) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.Symbol(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Symbol.property: object expected"); + message.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.Symbol.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.text != null) + message.text = String(object.text); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @static + * @param {google.cloud.vision.v1p1beta1.Symbol} message Symbol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Symbol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.text = ""; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Symbol to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.Symbol + * @instance + * @returns {Object.} JSON object + */ + Symbol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Symbol; + })(); + + v1p1beta1.WebDetection = (function() { + + /** + * Properties of a WebDetection. + * @memberof google.cloud.vision.v1p1beta1 + * @interface IWebDetection + * @property {Array.|null} [webEntities] WebDetection webEntities + * @property {Array.|null} [fullMatchingImages] WebDetection fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebDetection partialMatchingImages + * @property {Array.|null} [pagesWithMatchingImages] WebDetection pagesWithMatchingImages + * @property {Array.|null} [visuallySimilarImages] WebDetection visuallySimilarImages + * @property {Array.|null} [bestGuessLabels] WebDetection bestGuessLabels + */ + + /** + * Constructs a new WebDetection. + * @memberof google.cloud.vision.v1p1beta1 + * @classdesc Represents a WebDetection. + * @implements IWebDetection + * @constructor + * @param {google.cloud.vision.v1p1beta1.IWebDetection=} [properties] Properties to set + */ + function WebDetection(properties) { + this.webEntities = []; + this.fullMatchingImages = []; + this.partialMatchingImages = []; + this.pagesWithMatchingImages = []; + this.visuallySimilarImages = []; + this.bestGuessLabels = []; + 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]]; + } + + /** + * WebDetection webEntities. + * @member {Array.} webEntities + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @instance + */ + WebDetection.prototype.webEntities = $util.emptyArray; + + /** + * WebDetection fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @instance + */ + WebDetection.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebDetection partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @instance + */ + WebDetection.prototype.partialMatchingImages = $util.emptyArray; + + /** + * WebDetection pagesWithMatchingImages. + * @member {Array.} pagesWithMatchingImages + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @instance + */ + WebDetection.prototype.pagesWithMatchingImages = $util.emptyArray; + + /** + * WebDetection visuallySimilarImages. + * @member {Array.} visuallySimilarImages + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @instance + */ + WebDetection.prototype.visuallySimilarImages = $util.emptyArray; + + /** + * WebDetection bestGuessLabels. + * @member {Array.} bestGuessLabels + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @instance + */ + WebDetection.prototype.bestGuessLabels = $util.emptyArray; + + /** + * Creates a new WebDetection instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p1beta1.IWebDetection=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.WebDetection} WebDetection instance + */ + WebDetection.create = function create(properties) { + return new WebDetection(properties); + }; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p1beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webEntities != null && message.webEntities.length) + for (var i = 0; i < message.webEntities.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebEntity.encode(message.webEntities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pagesWithMatchingImages != null && message.pagesWithMatchingImages.length) + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebPage.encode(message.pagesWithMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.visuallySimilarImages != null && message.visuallySimilarImages.length) + for (var i = 0; i < message.visuallySimilarImages.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.encode(message.visuallySimilarImages[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bestGuessLabels != null && message.bestGuessLabels.length) + for (var i = 0; i < message.bestGuessLabels.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebLabel.encode(message.bestGuessLabels[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p1beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.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.vision.v1p1beta1.WebDetection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.webEntities && message.webEntities.length)) + message.webEntities = []; + message.webEntities.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebEntity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.pagesWithMatchingImages && message.pagesWithMatchingImages.length)) + message.pagesWithMatchingImages = []; + message.pagesWithMatchingImages.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebPage.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.visuallySimilarImages && message.visuallySimilarImages.length)) + message.visuallySimilarImages = []; + message.visuallySimilarImages.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.bestGuessLabels && message.bestGuessLabels.length)) + message.bestGuessLabels = []; + message.bestGuessLabels.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebLabel.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetection message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webEntities != null && message.hasOwnProperty("webEntities")) { + if (!Array.isArray(message.webEntities)) + return "webEntities: array expected"; + for (var i = 0; i < message.webEntities.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebEntity.verify(message.webEntities[i]); + if (error) + return "webEntities." + error; + } + } + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + if (message.pagesWithMatchingImages != null && message.hasOwnProperty("pagesWithMatchingImages")) { + if (!Array.isArray(message.pagesWithMatchingImages)) + return "pagesWithMatchingImages: array expected"; + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebPage.verify(message.pagesWithMatchingImages[i]); + if (error) + return "pagesWithMatchingImages." + error; + } + } + if (message.visuallySimilarImages != null && message.hasOwnProperty("visuallySimilarImages")) { + if (!Array.isArray(message.visuallySimilarImages)) + return "visuallySimilarImages: array expected"; + for (var i = 0; i < message.visuallySimilarImages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify(message.visuallySimilarImages[i]); + if (error) + return "visuallySimilarImages." + error; + } + } + if (message.bestGuessLabels != null && message.hasOwnProperty("bestGuessLabels")) { + if (!Array.isArray(message.bestGuessLabels)) + return "bestGuessLabels: array expected"; + for (var i = 0; i < message.bestGuessLabels.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebLabel.verify(message.bestGuessLabels[i]); + if (error) + return "bestGuessLabels." + error; + } + } + return null; + }; + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.WebDetection} WebDetection + */ + WebDetection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.WebDetection) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.WebDetection(); + if (object.webEntities) { + if (!Array.isArray(object.webEntities)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.webEntities: array expected"); + message.webEntities = []; + for (var i = 0; i < object.webEntities.length; ++i) { + if (typeof object.webEntities[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.webEntities: object expected"); + message.webEntities[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebEntity.fromObject(object.webEntities[i]); + } + } + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + if (object.pagesWithMatchingImages) { + if (!Array.isArray(object.pagesWithMatchingImages)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.pagesWithMatchingImages: array expected"); + message.pagesWithMatchingImages = []; + for (var i = 0; i < object.pagesWithMatchingImages.length; ++i) { + if (typeof object.pagesWithMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.pagesWithMatchingImages: object expected"); + message.pagesWithMatchingImages[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebPage.fromObject(object.pagesWithMatchingImages[i]); + } + } + if (object.visuallySimilarImages) { + if (!Array.isArray(object.visuallySimilarImages)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.visuallySimilarImages: array expected"); + message.visuallySimilarImages = []; + for (var i = 0; i < object.visuallySimilarImages.length; ++i) { + if (typeof object.visuallySimilarImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.visuallySimilarImages: object expected"); + message.visuallySimilarImages[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.fromObject(object.visuallySimilarImages[i]); + } + } + if (object.bestGuessLabels) { + if (!Array.isArray(object.bestGuessLabels)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.bestGuessLabels: array expected"); + message.bestGuessLabels = []; + for (var i = 0; i < object.bestGuessLabels.length; ++i) { + if (typeof object.bestGuessLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.bestGuessLabels: object expected"); + message.bestGuessLabels[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebLabel.fromObject(object.bestGuessLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection} message WebDetection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.webEntities = []; + object.fullMatchingImages = []; + object.partialMatchingImages = []; + object.pagesWithMatchingImages = []; + object.visuallySimilarImages = []; + object.bestGuessLabels = []; + } + if (message.webEntities && message.webEntities.length) { + object.webEntities = []; + for (var j = 0; j < message.webEntities.length; ++j) + object.webEntities[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebEntity.toObject(message.webEntities[j], options); + } + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + if (message.pagesWithMatchingImages && message.pagesWithMatchingImages.length) { + object.pagesWithMatchingImages = []; + for (var j = 0; j < message.pagesWithMatchingImages.length; ++j) + object.pagesWithMatchingImages[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebPage.toObject(message.pagesWithMatchingImages[j], options); + } + if (message.visuallySimilarImages && message.visuallySimilarImages.length) { + object.visuallySimilarImages = []; + for (var j = 0; j < message.visuallySimilarImages.length; ++j) + object.visuallySimilarImages[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.toObject(message.visuallySimilarImages[j], options); + } + if (message.bestGuessLabels && message.bestGuessLabels.length) { + object.bestGuessLabels = []; + for (var j = 0; j < message.bestGuessLabels.length; ++j) + object.bestGuessLabels[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebLabel.toObject(message.bestGuessLabels[j], options); + } + return object; + }; + + /** + * Converts this WebDetection to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @instance + * @returns {Object.} JSON object + */ + WebDetection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WebDetection.WebEntity = (function() { + + /** + * Properties of a WebEntity. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @interface IWebEntity + * @property {string|null} [entityId] WebEntity entityId + * @property {number|null} [score] WebEntity score + * @property {string|null} [description] WebEntity description + */ + + /** + * Constructs a new WebEntity. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @classdesc Represents a WebEntity. + * @implements IWebEntity + * @constructor + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebEntity=} [properties] Properties to set + */ + function WebEntity(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]]; + } + + /** + * WebEntity entityId. + * @member {string} entityId + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.entityId = ""; + + /** + * WebEntity score. + * @member {number} score + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.score = 0; + + /** + * WebEntity description. + * @member {string} description + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.description = ""; + + /** + * Creates a new WebEntity instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebEntity=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebEntity} WebEntity instance + */ + WebEntity.create = function create(properties) { + return new WebEntity(properties); + }; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && message.hasOwnProperty("entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.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.vision.v1p1beta1.WebDetection.WebEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entityId = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebEntity message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebEntity} WebEntity + */ + WebEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.WebDetection.WebEntity) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.WebDetection.WebEntity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.score != null) + message.score = Number(object.score); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.WebEntity} message WebEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.score = 0; + object.description = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this WebEntity to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebEntity + * @instance + * @returns {Object.} JSON object + */ + WebEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebEntity; + })(); + + WebDetection.WebImage = (function() { + + /** + * Properties of a WebImage. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @interface IWebImage + * @property {string|null} [url] WebImage url + * @property {number|null} [score] WebImage score + */ + + /** + * Constructs a new WebImage. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @classdesc Represents a WebImage. + * @implements IWebImage + * @constructor + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebImage=} [properties] Properties to set + */ + function WebImage(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]]; + } + + /** + * WebImage url. + * @member {string} url + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.url = ""; + + /** + * WebImage score. + * @member {number} score + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.score = 0; + + /** + * Creates a new WebImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebImage} WebImage instance + */ + WebImage.create = function create(properties) { + return new WebImage(properties); + }; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.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.vision.v1p1beta1.WebDetection.WebImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebImage message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebImage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebImage} WebImage + */ + WebImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.WebImage} message WebImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.score = 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this WebImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebImage + * @instance + * @returns {Object.} JSON object + */ + WebImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebImage; + })(); + + WebDetection.WebPage = (function() { + + /** + * Properties of a WebPage. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @interface IWebPage + * @property {string|null} [url] WebPage url + * @property {number|null} [score] WebPage score + * @property {string|null} [pageTitle] WebPage pageTitle + * @property {Array.|null} [fullMatchingImages] WebPage fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebPage partialMatchingImages + */ + + /** + * Constructs a new WebPage. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @classdesc Represents a WebPage. + * @implements IWebPage + * @constructor + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebPage=} [properties] Properties to set + */ + function WebPage(properties) { + this.fullMatchingImages = []; + this.partialMatchingImages = []; + 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]]; + } + + /** + * WebPage url. + * @member {string} url + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.url = ""; + + /** + * WebPage score. + * @member {number} score + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.score = 0; + + /** + * WebPage pageTitle. + * @member {string} pageTitle + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.pageTitle = ""; + + /** + * WebPage fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebPage partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.partialMatchingImages = $util.emptyArray; + + /** + * Creates a new WebPage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebPage} WebPage instance + */ + WebPage.create = function create(properties) { + return new WebPage(properties); + }; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebPage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageTitle); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebPage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.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.vision.v1p1beta1.WebDetection.WebPage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pageTitle = reader.string(); + break; + case 4: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebPage message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebPage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + if (!$util.isString(message.pageTitle)) + return "pageTitle: string expected"; + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + return null; + }; + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebPage} WebPage + */ + WebPage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.WebDetection.WebPage) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.WebDetection.WebPage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + if (object.pageTitle != null) + message.pageTitle = String(object.pageTitle); + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.WebPage.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.WebPage.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.WebPage.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p1beta1.WebDetection.WebPage.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.WebPage} message WebPage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebPage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fullMatchingImages = []; + object.partialMatchingImages = []; + } + if (options.defaults) { + object.url = ""; + object.score = 0; + object.pageTitle = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + object.pageTitle = message.pageTitle; + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p1beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + return object; + }; + + /** + * Converts this WebPage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebPage + * @instance + * @returns {Object.} JSON object + */ + WebPage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebPage; + })(); + + WebDetection.WebLabel = (function() { + + /** + * Properties of a WebLabel. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @interface IWebLabel + * @property {string|null} [label] WebLabel label + * @property {string|null} [languageCode] WebLabel languageCode + */ + + /** + * Constructs a new WebLabel. + * @memberof google.cloud.vision.v1p1beta1.WebDetection + * @classdesc Represents a WebLabel. + * @implements IWebLabel + * @constructor + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebLabel=} [properties] Properties to set + */ + function WebLabel(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]]; + } + + /** + * WebLabel label. + * @member {string} label + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.label = ""; + + /** + * WebLabel languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.languageCode = ""; + + /** + * Creates a new WebLabel instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebLabel=} [properties] Properties to set + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebLabel} WebLabel instance + */ + WebLabel.create = function create(properties) { + return new WebLabel(properties); + }; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p1beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.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.vision.v1p1beta1.WebDetection.WebLabel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebLabel message. + * @function verify + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebLabel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p1beta1.WebDetection.WebLabel} WebLabel + */ + WebLabel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p1beta1.WebDetection.WebLabel) + return object; + var message = new $root.google.cloud.vision.v1p1beta1.WebDetection.WebLabel(); + if (object.label != null) + message.label = String(object.label); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p1beta1.WebDetection.WebLabel} message WebLabel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebLabel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.languageCode = ""; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this WebLabel to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p1beta1.WebDetection.WebLabel + * @instance + * @returns {Object.} JSON object + */ + WebLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebLabel; + })(); + + return WebDetection; + })(); + + return v1p1beta1; + })(); + + vision.v1p2beta1 = (function() { + + /** + * Namespace v1p2beta1. + * @memberof google.cloud.vision + * @namespace + */ + var v1p2beta1 = {}; + + v1p2beta1.ImageAnnotator = (function() { + + /** + * Constructs a new ImageAnnotator service. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an ImageAnnotator + * @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 ImageAnnotator(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ImageAnnotator.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageAnnotator; + + /** + * Creates new ImageAnnotator service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotator + * @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 {ImageAnnotator} RPC service. Useful where requests and/or responses are streamed. + */ + ImageAnnotator.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1p2beta1.ImageAnnotator#batchAnnotateImages}. + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotator + * @typedef BatchAnnotateImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse} [response] BatchAnnotateImagesResponse + */ + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @param {google.cloud.vision.v1p2beta1.ImageAnnotator.BatchAnnotateImagesCallback} callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.batchAnnotateImages = function batchAnnotateImages(request, callback) { + return this.rpcCall(batchAnnotateImages, $root.google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest, $root.google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse, request, callback); + }, "name", { value: "BatchAnnotateImages" }); + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p2beta1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotator + * @typedef AsyncBatchAnnotateFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @param {google.cloud.vision.v1p2beta1.ImageAnnotator.AsyncBatchAnnotateFilesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.asyncBatchAnnotateFiles = function asyncBatchAnnotateFiles(request, callback) { + return this.rpcCall(asyncBatchAnnotateFiles, $root.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AsyncBatchAnnotateFiles" }); + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ImageAnnotator; + })(); + + v1p2beta1.Feature = (function() { + + /** + * Properties of a Feature. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IFeature + * @property {google.cloud.vision.v1p2beta1.Feature.Type|null} [type] Feature type + * @property {number|null} [maxResults] Feature maxResults + * @property {string|null} [model] Feature model + */ + + /** + * Constructs a new Feature. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Feature. + * @implements IFeature + * @constructor + * @param {google.cloud.vision.v1p2beta1.IFeature=} [properties] Properties to set + */ + function Feature(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]]; + } + + /** + * Feature type. + * @member {google.cloud.vision.v1p2beta1.Feature.Type} type + * @memberof google.cloud.vision.v1p2beta1.Feature + * @instance + */ + Feature.prototype.type = 0; + + /** + * Feature maxResults. + * @member {number} maxResults + * @memberof google.cloud.vision.v1p2beta1.Feature + * @instance + */ + Feature.prototype.maxResults = 0; + + /** + * Feature model. + * @member {string} model + * @memberof google.cloud.vision.v1p2beta1.Feature + * @instance + */ + Feature.prototype.model = ""; + + /** + * Creates a new Feature instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {google.cloud.vision.v1p2beta1.IFeature=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Feature} Feature instance + */ + Feature.create = function create(properties) { + return new Feature(properties); + }; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Feature.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {google.cloud.vision.v1p2beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxResults); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Feature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {google.cloud.vision.v1p2beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.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.vision.v1p2beta1.Feature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.maxResults = reader.int32(); + break; + case 3: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feature message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 11: + case 6: + case 7: + case 9: + case 10: + break; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Feature} Feature + */ + Feature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Feature) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Feature(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "FACE_DETECTION": + case 1: + message.type = 1; + break; + case "LANDMARK_DETECTION": + case 2: + message.type = 2; + break; + case "LOGO_DETECTION": + case 3: + message.type = 3; + break; + case "LABEL_DETECTION": + case 4: + message.type = 4; + break; + case "TEXT_DETECTION": + case 5: + message.type = 5; + break; + case "DOCUMENT_TEXT_DETECTION": + case 11: + message.type = 11; + break; + case "SAFE_SEARCH_DETECTION": + case 6: + message.type = 6; + break; + case "IMAGE_PROPERTIES": + case 7: + message.type = 7; + break; + case "CROP_HINTS": + case 9: + message.type = 9; + break; + case "WEB_DETECTION": + case 10: + message.type = 10; + break; + } + if (object.maxResults != null) + message.maxResults = object.maxResults | 0; + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Feature + * @static + * @param {google.cloud.vision.v1p2beta1.Feature} message Feature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.maxResults = 0; + object.model = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Feature.Type[message.type] : message.type; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + object.maxResults = message.maxResults; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this Feature to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Feature + * @instance + * @returns {Object.} JSON object + */ + Feature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p2beta1.Feature.Type + * @enum {string} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} FACE_DETECTION=1 FACE_DETECTION value + * @property {number} LANDMARK_DETECTION=2 LANDMARK_DETECTION value + * @property {number} LOGO_DETECTION=3 LOGO_DETECTION value + * @property {number} LABEL_DETECTION=4 LABEL_DETECTION value + * @property {number} TEXT_DETECTION=5 TEXT_DETECTION value + * @property {number} DOCUMENT_TEXT_DETECTION=11 DOCUMENT_TEXT_DETECTION value + * @property {number} SAFE_SEARCH_DETECTION=6 SAFE_SEARCH_DETECTION value + * @property {number} IMAGE_PROPERTIES=7 IMAGE_PROPERTIES value + * @property {number} CROP_HINTS=9 CROP_HINTS value + * @property {number} WEB_DETECTION=10 WEB_DETECTION value + */ + Feature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACE_DETECTION"] = 1; + values[valuesById[2] = "LANDMARK_DETECTION"] = 2; + values[valuesById[3] = "LOGO_DETECTION"] = 3; + values[valuesById[4] = "LABEL_DETECTION"] = 4; + values[valuesById[5] = "TEXT_DETECTION"] = 5; + values[valuesById[11] = "DOCUMENT_TEXT_DETECTION"] = 11; + values[valuesById[6] = "SAFE_SEARCH_DETECTION"] = 6; + values[valuesById[7] = "IMAGE_PROPERTIES"] = 7; + values[valuesById[9] = "CROP_HINTS"] = 9; + values[valuesById[10] = "WEB_DETECTION"] = 10; + return values; + })(); + + return Feature; + })(); + + v1p2beta1.ImageSource = (function() { + + /** + * Properties of an ImageSource. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IImageSource + * @property {string|null} [gcsImageUri] ImageSource gcsImageUri + * @property {string|null} [imageUri] ImageSource imageUri + */ + + /** + * Constructs a new ImageSource. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an ImageSource. + * @implements IImageSource + * @constructor + * @param {google.cloud.vision.v1p2beta1.IImageSource=} [properties] Properties to set + */ + function ImageSource(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]]; + } + + /** + * ImageSource gcsImageUri. + * @member {string} gcsImageUri + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @instance + */ + ImageSource.prototype.gcsImageUri = ""; + + /** + * ImageSource imageUri. + * @member {string} imageUri + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @instance + */ + ImageSource.prototype.imageUri = ""; + + /** + * Creates a new ImageSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p2beta1.IImageSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.ImageSource} ImageSource instance + */ + ImageSource.create = function create(properties) { + return new ImageSource(properties); + }; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p2beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsImageUri); + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageUri); + return writer; + }; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p2beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.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.vision.v1p2beta1.ImageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsImageUri = reader.string(); + break; + case 2: + message.imageUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSource message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + if (!$util.isString(message.gcsImageUri)) + return "gcsImageUri: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + return null; + }; + + /** + * Creates an ImageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.ImageSource} ImageSource + */ + ImageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.ImageSource) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.ImageSource(); + if (object.gcsImageUri != null) + message.gcsImageUri = String(object.gcsImageUri); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + return message; + }; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p2beta1.ImageSource} message ImageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsImageUri = ""; + object.imageUri = ""; + } + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + object.gcsImageUri = message.gcsImageUri; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + return object; + }; + + /** + * Converts this ImageSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.ImageSource + * @instance + * @returns {Object.} JSON object + */ + ImageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageSource; + })(); + + v1p2beta1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IImage + * @property {Uint8Array|null} [content] Image content + * @property {google.cloud.vision.v1p2beta1.IImageSource|null} [source] Image source + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.vision.v1p2beta1.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 content. + * @member {Uint8Array} content + * @memberof google.cloud.vision.v1p2beta1.Image + * @instance + */ + Image.prototype.content = $util.newBuffer([]); + + /** + * Image source. + * @member {google.cloud.vision.v1p2beta1.IImageSource|null|undefined} source + * @memberof google.cloud.vision.v1p2beta1.Image + * @instance + */ + Image.prototype.source = null; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Image + * @static + * @param {google.cloud.vision.v1p2beta1.IImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Image + * @static + * @param {google.cloud.vision.v1p2beta1.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.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.vision.v1p2beta1.ImageSource.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Image + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.bytes(); + break; + case 2: + message.source = $root.google.cloud.vision.v1p2beta1.ImageSource.decode(reader, reader.uint32()); + 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.vision.v1p2beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.vision.v1p2beta1.ImageSource.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Image) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Image(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Image.source: object expected"); + message.source = $root.google.cloud.vision.v1p2beta1.ImageSource.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Image + * @static + * @param {google.cloud.vision.v1p2beta1.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) { + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + object.source = null; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.vision.v1p2beta1.ImageSource.toObject(message.source, options); + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Image; + })(); + + v1p2beta1.FaceAnnotation = (function() { + + /** + * Properties of a FaceAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IFaceAnnotation + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [boundingPoly] FaceAnnotation boundingPoly + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [fdBoundingPoly] FaceAnnotation fdBoundingPoly + * @property {Array.|null} [landmarks] FaceAnnotation landmarks + * @property {number|null} [rollAngle] FaceAnnotation rollAngle + * @property {number|null} [panAngle] FaceAnnotation panAngle + * @property {number|null} [tiltAngle] FaceAnnotation tiltAngle + * @property {number|null} [detectionConfidence] FaceAnnotation detectionConfidence + * @property {number|null} [landmarkingConfidence] FaceAnnotation landmarkingConfidence + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [joyLikelihood] FaceAnnotation joyLikelihood + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [sorrowLikelihood] FaceAnnotation sorrowLikelihood + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [angerLikelihood] FaceAnnotation angerLikelihood + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [surpriseLikelihood] FaceAnnotation surpriseLikelihood + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [underExposedLikelihood] FaceAnnotation underExposedLikelihood + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [blurredLikelihood] FaceAnnotation blurredLikelihood + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [headwearLikelihood] FaceAnnotation headwearLikelihood + */ + + /** + * Constructs a new FaceAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a FaceAnnotation. + * @implements IFaceAnnotation + * @constructor + * @param {google.cloud.vision.v1p2beta1.IFaceAnnotation=} [properties] Properties to set + */ + function FaceAnnotation(properties) { + this.landmarks = []; + 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]]; + } + + /** + * FaceAnnotation boundingPoly. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.boundingPoly = null; + + /** + * FaceAnnotation fdBoundingPoly. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} fdBoundingPoly + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.fdBoundingPoly = null; + + /** + * FaceAnnotation landmarks. + * @member {Array.} landmarks + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarks = $util.emptyArray; + + /** + * FaceAnnotation rollAngle. + * @member {number} rollAngle + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.rollAngle = 0; + + /** + * FaceAnnotation panAngle. + * @member {number} panAngle + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.panAngle = 0; + + /** + * FaceAnnotation tiltAngle. + * @member {number} tiltAngle + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.tiltAngle = 0; + + /** + * FaceAnnotation detectionConfidence. + * @member {number} detectionConfidence + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.detectionConfidence = 0; + + /** + * FaceAnnotation landmarkingConfidence. + * @member {number} landmarkingConfidence + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarkingConfidence = 0; + + /** + * FaceAnnotation joyLikelihood. + * @member {google.cloud.vision.v1p2beta1.Likelihood} joyLikelihood + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.joyLikelihood = 0; + + /** + * FaceAnnotation sorrowLikelihood. + * @member {google.cloud.vision.v1p2beta1.Likelihood} sorrowLikelihood + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.sorrowLikelihood = 0; + + /** + * FaceAnnotation angerLikelihood. + * @member {google.cloud.vision.v1p2beta1.Likelihood} angerLikelihood + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.angerLikelihood = 0; + + /** + * FaceAnnotation surpriseLikelihood. + * @member {google.cloud.vision.v1p2beta1.Likelihood} surpriseLikelihood + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.surpriseLikelihood = 0; + + /** + * FaceAnnotation underExposedLikelihood. + * @member {google.cloud.vision.v1p2beta1.Likelihood} underExposedLikelihood + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.underExposedLikelihood = 0; + + /** + * FaceAnnotation blurredLikelihood. + * @member {google.cloud.vision.v1p2beta1.Likelihood} blurredLikelihood + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.blurredLikelihood = 0; + + /** + * FaceAnnotation headwearLikelihood. + * @member {google.cloud.vision.v1p2beta1.Likelihood} headwearLikelihood + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.headwearLikelihood = 0; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IFaceAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation} FaceAnnotation instance + */ + FaceAnnotation.create = function create(properties) { + return new FaceAnnotation(properties); + }; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.fdBoundingPoly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.landmarks != null && message.landmarks.length) + for (var i = 0; i < message.landmarks.length; ++i) + $root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.encode(message.landmarks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.rollAngle); + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.panAngle); + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.tiltAngle); + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.detectionConfidence); + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.landmarkingConfidence); + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.joyLikelihood); + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sorrowLikelihood); + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.angerLikelihood); + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.surpriseLikelihood); + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.underExposedLikelihood); + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.blurredLikelihood); + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.headwearLikelihood); + return writer; + }; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.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.vision.v1p2beta1.FaceAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.fdBoundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.landmarks && message.landmarks.length)) + message.landmarks = []; + message.landmarks.push($root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.decode(reader, reader.uint32())); + break; + case 4: + message.rollAngle = reader.float(); + break; + case 5: + message.panAngle = reader.float(); + break; + case 6: + message.tiltAngle = reader.float(); + break; + case 7: + message.detectionConfidence = reader.float(); + break; + case 8: + message.landmarkingConfidence = reader.float(); + break; + case 9: + message.joyLikelihood = reader.int32(); + break; + case 10: + message.sorrowLikelihood = reader.int32(); + break; + case 11: + message.angerLikelihood = reader.int32(); + break; + case 12: + message.surpriseLikelihood = reader.int32(); + break; + case 13: + message.underExposedLikelihood = reader.int32(); + break; + case 14: + message.blurredLikelihood = reader.int32(); + break; + case 15: + message.headwearLikelihood = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.fdBoundingPoly); + if (error) + return "fdBoundingPoly." + error; + } + if (message.landmarks != null && message.hasOwnProperty("landmarks")) { + if (!Array.isArray(message.landmarks)) + return "landmarks: array expected"; + for (var i = 0; i < message.landmarks.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.verify(message.landmarks[i]); + if (error) + return "landmarks." + error; + } + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + if (typeof message.rollAngle !== "number") + return "rollAngle: number expected"; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + if (typeof message.panAngle !== "number") + return "panAngle: number expected"; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + if (typeof message.tiltAngle !== "number") + return "tiltAngle: number expected"; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + if (typeof message.detectionConfidence !== "number") + return "detectionConfidence: number expected"; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + if (typeof message.landmarkingConfidence !== "number") + return "landmarkingConfidence: number expected"; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + switch (message.joyLikelihood) { + default: + return "joyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + switch (message.sorrowLikelihood) { + default: + return "sorrowLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + switch (message.angerLikelihood) { + default: + return "angerLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + switch (message.surpriseLikelihood) { + default: + return "surpriseLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + switch (message.underExposedLikelihood) { + default: + return "underExposedLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + switch (message.blurredLikelihood) { + default: + return "blurredLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + switch (message.headwearLikelihood) { + default: + return "headwearLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation} FaceAnnotation + */ + FaceAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.FaceAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.FaceAnnotation(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.FaceAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.fdBoundingPoly != null) { + if (typeof object.fdBoundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.FaceAnnotation.fdBoundingPoly: object expected"); + message.fdBoundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.fdBoundingPoly); + } + if (object.landmarks) { + if (!Array.isArray(object.landmarks)) + throw TypeError(".google.cloud.vision.v1p2beta1.FaceAnnotation.landmarks: array expected"); + message.landmarks = []; + for (var i = 0; i < object.landmarks.length; ++i) { + if (typeof object.landmarks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.FaceAnnotation.landmarks: object expected"); + message.landmarks[i] = $root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.fromObject(object.landmarks[i]); + } + } + if (object.rollAngle != null) + message.rollAngle = Number(object.rollAngle); + if (object.panAngle != null) + message.panAngle = Number(object.panAngle); + if (object.tiltAngle != null) + message.tiltAngle = Number(object.tiltAngle); + if (object.detectionConfidence != null) + message.detectionConfidence = Number(object.detectionConfidence); + if (object.landmarkingConfidence != null) + message.landmarkingConfidence = Number(object.landmarkingConfidence); + switch (object.joyLikelihood) { + case "UNKNOWN": + case 0: + message.joyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.joyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.joyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.joyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.joyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.joyLikelihood = 5; + break; + } + switch (object.sorrowLikelihood) { + case "UNKNOWN": + case 0: + message.sorrowLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.sorrowLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.sorrowLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.sorrowLikelihood = 3; + break; + case "LIKELY": + case 4: + message.sorrowLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.sorrowLikelihood = 5; + break; + } + switch (object.angerLikelihood) { + case "UNKNOWN": + case 0: + message.angerLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.angerLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.angerLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.angerLikelihood = 3; + break; + case "LIKELY": + case 4: + message.angerLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.angerLikelihood = 5; + break; + } + switch (object.surpriseLikelihood) { + case "UNKNOWN": + case 0: + message.surpriseLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.surpriseLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.surpriseLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.surpriseLikelihood = 3; + break; + case "LIKELY": + case 4: + message.surpriseLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.surpriseLikelihood = 5; + break; + } + switch (object.underExposedLikelihood) { + case "UNKNOWN": + case 0: + message.underExposedLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.underExposedLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.underExposedLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.underExposedLikelihood = 3; + break; + case "LIKELY": + case 4: + message.underExposedLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.underExposedLikelihood = 5; + break; + } + switch (object.blurredLikelihood) { + case "UNKNOWN": + case 0: + message.blurredLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.blurredLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.blurredLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.blurredLikelihood = 3; + break; + case "LIKELY": + case 4: + message.blurredLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.blurredLikelihood = 5; + break; + } + switch (object.headwearLikelihood) { + case "UNKNOWN": + case 0: + message.headwearLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.headwearLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.headwearLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.headwearLikelihood = 3; + break; + case "LIKELY": + case 4: + message.headwearLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.headwearLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.FaceAnnotation} message FaceAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.landmarks = []; + if (options.defaults) { + object.boundingPoly = null; + object.fdBoundingPoly = null; + object.rollAngle = 0; + object.panAngle = 0; + object.tiltAngle = 0; + object.detectionConfidence = 0; + object.landmarkingConfidence = 0; + object.joyLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.sorrowLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.angerLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.surpriseLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.underExposedLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.blurredLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.headwearLikelihood = options.enums === String ? "UNKNOWN" : 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + object.fdBoundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.fdBoundingPoly, options); + if (message.landmarks && message.landmarks.length) { + object.landmarks = []; + for (var j = 0; j < message.landmarks.length; ++j) + object.landmarks[j] = $root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.toObject(message.landmarks[j], options); + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + object.rollAngle = options.json && !isFinite(message.rollAngle) ? String(message.rollAngle) : message.rollAngle; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + object.panAngle = options.json && !isFinite(message.panAngle) ? String(message.panAngle) : message.panAngle; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + object.tiltAngle = options.json && !isFinite(message.tiltAngle) ? String(message.tiltAngle) : message.tiltAngle; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + object.detectionConfidence = options.json && !isFinite(message.detectionConfidence) ? String(message.detectionConfidence) : message.detectionConfidence; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + object.landmarkingConfidence = options.json && !isFinite(message.landmarkingConfidence) ? String(message.landmarkingConfidence) : message.landmarkingConfidence; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + object.joyLikelihood = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.joyLikelihood] : message.joyLikelihood; + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + object.sorrowLikelihood = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.sorrowLikelihood] : message.sorrowLikelihood; + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + object.angerLikelihood = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.angerLikelihood] : message.angerLikelihood; + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + object.surpriseLikelihood = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.surpriseLikelihood] : message.surpriseLikelihood; + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + object.underExposedLikelihood = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.underExposedLikelihood] : message.underExposedLikelihood; + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + object.blurredLikelihood = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.blurredLikelihood] : message.blurredLikelihood; + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + object.headwearLikelihood = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.headwearLikelihood] : message.headwearLikelihood; + return object; + }; + + /** + * Converts this FaceAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FaceAnnotation.Landmark = (function() { + + /** + * Properties of a Landmark. + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @interface ILandmark + * @property {google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type|null} [type] Landmark type + * @property {google.cloud.vision.v1p2beta1.IPosition|null} [position] Landmark position + */ + + /** + * Constructs a new Landmark. + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation + * @classdesc Represents a Landmark. + * @implements ILandmark + * @constructor + * @param {google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + */ + function Landmark(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]]; + } + + /** + * Landmark type. + * @member {google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type} type + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.type = 0; + + /** + * Landmark position. + * @member {google.cloud.vision.v1p2beta1.IPosition|null|undefined} position + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.position = null; + + /** + * Creates a new Landmark instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark} Landmark instance + */ + Landmark.create = function create(properties) { + return new Landmark(properties); + }; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.position != null && message.hasOwnProperty("position")) + $root.google.cloud.vision.v1p2beta1.Position.encode(message.position, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p2beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.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.vision.v1p2beta1.FaceAnnotation.Landmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.type = reader.int32(); + break; + case 4: + message.position = $root.google.cloud.vision.v1p2beta1.Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Landmark message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Landmark.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + break; + } + if (message.position != null && message.hasOwnProperty("position")) { + var error = $root.google.cloud.vision.v1p2beta1.Position.verify(message.position); + if (error) + return "position." + error; + } + return null; + }; + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark} Landmark + */ + Landmark.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark(); + switch (object.type) { + case "UNKNOWN_LANDMARK": + case 0: + message.type = 0; + break; + case "LEFT_EYE": + case 1: + message.type = 1; + break; + case "RIGHT_EYE": + case 2: + message.type = 2; + break; + case "LEFT_OF_LEFT_EYEBROW": + case 3: + message.type = 3; + break; + case "RIGHT_OF_LEFT_EYEBROW": + case 4: + message.type = 4; + break; + case "LEFT_OF_RIGHT_EYEBROW": + case 5: + message.type = 5; + break; + case "RIGHT_OF_RIGHT_EYEBROW": + case 6: + message.type = 6; + break; + case "MIDPOINT_BETWEEN_EYES": + case 7: + message.type = 7; + break; + case "NOSE_TIP": + case 8: + message.type = 8; + break; + case "UPPER_LIP": + case 9: + message.type = 9; + break; + case "LOWER_LIP": + case 10: + message.type = 10; + break; + case "MOUTH_LEFT": + case 11: + message.type = 11; + break; + case "MOUTH_RIGHT": + case 12: + message.type = 12; + break; + case "MOUTH_CENTER": + case 13: + message.type = 13; + break; + case "NOSE_BOTTOM_RIGHT": + case 14: + message.type = 14; + break; + case "NOSE_BOTTOM_LEFT": + case 15: + message.type = 15; + break; + case "NOSE_BOTTOM_CENTER": + case 16: + message.type = 16; + break; + case "LEFT_EYE_TOP_BOUNDARY": + case 17: + message.type = 17; + break; + case "LEFT_EYE_RIGHT_CORNER": + case 18: + message.type = 18; + break; + case "LEFT_EYE_BOTTOM_BOUNDARY": + case 19: + message.type = 19; + break; + case "LEFT_EYE_LEFT_CORNER": + case 20: + message.type = 20; + break; + case "RIGHT_EYE_TOP_BOUNDARY": + case 21: + message.type = 21; + break; + case "RIGHT_EYE_RIGHT_CORNER": + case 22: + message.type = 22; + break; + case "RIGHT_EYE_BOTTOM_BOUNDARY": + case 23: + message.type = 23; + break; + case "RIGHT_EYE_LEFT_CORNER": + case 24: + message.type = 24; + break; + case "LEFT_EYEBROW_UPPER_MIDPOINT": + case 25: + message.type = 25; + break; + case "RIGHT_EYEBROW_UPPER_MIDPOINT": + case 26: + message.type = 26; + break; + case "LEFT_EAR_TRAGION": + case 27: + message.type = 27; + break; + case "RIGHT_EAR_TRAGION": + case 28: + message.type = 28; + break; + case "LEFT_EYE_PUPIL": + case 29: + message.type = 29; + break; + case "RIGHT_EYE_PUPIL": + case 30: + message.type = 30; + break; + case "FOREHEAD_GLABELLA": + case 31: + message.type = 31; + break; + case "CHIN_GNATHION": + case 32: + message.type = 32; + break; + case "CHIN_LEFT_GONION": + case 33: + message.type = 33; + break; + case "CHIN_RIGHT_GONION": + case 34: + message.type = 34; + break; + } + if (object.position != null) { + if (typeof object.position !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.position: object expected"); + message.position = $root.google.cloud.vision.v1p2beta1.Position.fromObject(object.position); + } + return message; + }; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark} message Landmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Landmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN_LANDMARK" : 0; + object.position = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type[message.type] : message.type; + if (message.position != null && message.hasOwnProperty("position")) + object.position = $root.google.cloud.vision.v1p2beta1.Position.toObject(message.position, options); + return object; + }; + + /** + * Converts this Landmark to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark + * @instance + * @returns {Object.} JSON object + */ + Landmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type + * @enum {string} + * @property {number} UNKNOWN_LANDMARK=0 UNKNOWN_LANDMARK value + * @property {number} LEFT_EYE=1 LEFT_EYE value + * @property {number} RIGHT_EYE=2 RIGHT_EYE value + * @property {number} LEFT_OF_LEFT_EYEBROW=3 LEFT_OF_LEFT_EYEBROW value + * @property {number} RIGHT_OF_LEFT_EYEBROW=4 RIGHT_OF_LEFT_EYEBROW value + * @property {number} LEFT_OF_RIGHT_EYEBROW=5 LEFT_OF_RIGHT_EYEBROW value + * @property {number} RIGHT_OF_RIGHT_EYEBROW=6 RIGHT_OF_RIGHT_EYEBROW value + * @property {number} MIDPOINT_BETWEEN_EYES=7 MIDPOINT_BETWEEN_EYES value + * @property {number} NOSE_TIP=8 NOSE_TIP value + * @property {number} UPPER_LIP=9 UPPER_LIP value + * @property {number} LOWER_LIP=10 LOWER_LIP value + * @property {number} MOUTH_LEFT=11 MOUTH_LEFT value + * @property {number} MOUTH_RIGHT=12 MOUTH_RIGHT value + * @property {number} MOUTH_CENTER=13 MOUTH_CENTER value + * @property {number} NOSE_BOTTOM_RIGHT=14 NOSE_BOTTOM_RIGHT value + * @property {number} NOSE_BOTTOM_LEFT=15 NOSE_BOTTOM_LEFT value + * @property {number} NOSE_BOTTOM_CENTER=16 NOSE_BOTTOM_CENTER value + * @property {number} LEFT_EYE_TOP_BOUNDARY=17 LEFT_EYE_TOP_BOUNDARY value + * @property {number} LEFT_EYE_RIGHT_CORNER=18 LEFT_EYE_RIGHT_CORNER value + * @property {number} LEFT_EYE_BOTTOM_BOUNDARY=19 LEFT_EYE_BOTTOM_BOUNDARY value + * @property {number} LEFT_EYE_LEFT_CORNER=20 LEFT_EYE_LEFT_CORNER value + * @property {number} RIGHT_EYE_TOP_BOUNDARY=21 RIGHT_EYE_TOP_BOUNDARY value + * @property {number} RIGHT_EYE_RIGHT_CORNER=22 RIGHT_EYE_RIGHT_CORNER value + * @property {number} RIGHT_EYE_BOTTOM_BOUNDARY=23 RIGHT_EYE_BOTTOM_BOUNDARY value + * @property {number} RIGHT_EYE_LEFT_CORNER=24 RIGHT_EYE_LEFT_CORNER value + * @property {number} LEFT_EYEBROW_UPPER_MIDPOINT=25 LEFT_EYEBROW_UPPER_MIDPOINT value + * @property {number} RIGHT_EYEBROW_UPPER_MIDPOINT=26 RIGHT_EYEBROW_UPPER_MIDPOINT value + * @property {number} LEFT_EAR_TRAGION=27 LEFT_EAR_TRAGION value + * @property {number} RIGHT_EAR_TRAGION=28 RIGHT_EAR_TRAGION value + * @property {number} LEFT_EYE_PUPIL=29 LEFT_EYE_PUPIL value + * @property {number} RIGHT_EYE_PUPIL=30 RIGHT_EYE_PUPIL value + * @property {number} FOREHEAD_GLABELLA=31 FOREHEAD_GLABELLA value + * @property {number} CHIN_GNATHION=32 CHIN_GNATHION value + * @property {number} CHIN_LEFT_GONION=33 CHIN_LEFT_GONION value + * @property {number} CHIN_RIGHT_GONION=34 CHIN_RIGHT_GONION value + */ + Landmark.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_LANDMARK"] = 0; + values[valuesById[1] = "LEFT_EYE"] = 1; + values[valuesById[2] = "RIGHT_EYE"] = 2; + values[valuesById[3] = "LEFT_OF_LEFT_EYEBROW"] = 3; + values[valuesById[4] = "RIGHT_OF_LEFT_EYEBROW"] = 4; + values[valuesById[5] = "LEFT_OF_RIGHT_EYEBROW"] = 5; + values[valuesById[6] = "RIGHT_OF_RIGHT_EYEBROW"] = 6; + values[valuesById[7] = "MIDPOINT_BETWEEN_EYES"] = 7; + values[valuesById[8] = "NOSE_TIP"] = 8; + values[valuesById[9] = "UPPER_LIP"] = 9; + values[valuesById[10] = "LOWER_LIP"] = 10; + values[valuesById[11] = "MOUTH_LEFT"] = 11; + values[valuesById[12] = "MOUTH_RIGHT"] = 12; + values[valuesById[13] = "MOUTH_CENTER"] = 13; + values[valuesById[14] = "NOSE_BOTTOM_RIGHT"] = 14; + values[valuesById[15] = "NOSE_BOTTOM_LEFT"] = 15; + values[valuesById[16] = "NOSE_BOTTOM_CENTER"] = 16; + values[valuesById[17] = "LEFT_EYE_TOP_BOUNDARY"] = 17; + values[valuesById[18] = "LEFT_EYE_RIGHT_CORNER"] = 18; + values[valuesById[19] = "LEFT_EYE_BOTTOM_BOUNDARY"] = 19; + values[valuesById[20] = "LEFT_EYE_LEFT_CORNER"] = 20; + values[valuesById[21] = "RIGHT_EYE_TOP_BOUNDARY"] = 21; + values[valuesById[22] = "RIGHT_EYE_RIGHT_CORNER"] = 22; + values[valuesById[23] = "RIGHT_EYE_BOTTOM_BOUNDARY"] = 23; + values[valuesById[24] = "RIGHT_EYE_LEFT_CORNER"] = 24; + values[valuesById[25] = "LEFT_EYEBROW_UPPER_MIDPOINT"] = 25; + values[valuesById[26] = "RIGHT_EYEBROW_UPPER_MIDPOINT"] = 26; + values[valuesById[27] = "LEFT_EAR_TRAGION"] = 27; + values[valuesById[28] = "RIGHT_EAR_TRAGION"] = 28; + values[valuesById[29] = "LEFT_EYE_PUPIL"] = 29; + values[valuesById[30] = "RIGHT_EYE_PUPIL"] = 30; + values[valuesById[31] = "FOREHEAD_GLABELLA"] = 31; + values[valuesById[32] = "CHIN_GNATHION"] = 32; + values[valuesById[33] = "CHIN_LEFT_GONION"] = 33; + values[valuesById[34] = "CHIN_RIGHT_GONION"] = 34; + return values; + })(); + + return Landmark; + })(); + + return FaceAnnotation; + })(); + + v1p2beta1.LocationInfo = (function() { + + /** + * Properties of a LocationInfo. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ILocationInfo + * @property {google.type.ILatLng|null} [latLng] LocationInfo latLng + */ + + /** + * Constructs a new LocationInfo. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo + * @constructor + * @param {google.cloud.vision.v1p2beta1.ILocationInfo=} [properties] Properties to set + */ + function LocationInfo(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]]; + } + + /** + * LocationInfo latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @instance + */ + LocationInfo.prototype.latLng = null; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p2beta1.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.LocationInfo} LocationInfo instance + */ + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); + }; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p2beta1.LocationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p2beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && message.hasOwnProperty("latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.LocationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p2beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.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.vision.v1p2beta1.LocationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationInfo message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + return null; + }; + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.LocationInfo} LocationInfo + */ + LocationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.LocationInfo) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.LocationInfo(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.LocationInfo.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + return message; + }; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p2beta1.LocationInfo} message LocationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.latLng = null; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + return object; + }; + + /** + * Converts this LocationInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.LocationInfo + * @instance + * @returns {Object.} JSON object + */ + LocationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationInfo; + })(); + + v1p2beta1.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [value] Property value + * @property {number|Long|null} [uint64Value] Property uint64Value + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.vision.v1p2beta1.IProperty=} [properties] Properties to set + */ + function Property(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]]; + } + + /** + * Property name. + * @member {string} name + * @memberof google.cloud.vision.v1p2beta1.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property value. + * @member {string} value + * @memberof google.cloud.vision.v1p2beta1.Property + * @instance + */ + Property.prototype.value = ""; + + /** + * Property uint64Value. + * @member {number|Long} uint64Value + * @memberof google.cloud.vision.v1p2beta1.Property + * @instance + */ + Property.prototype.uint64Value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {google.cloud.vision.v1p2beta1.IProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {google.cloud.vision.v1p2beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.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.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.uint64Value); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {google.cloud.vision.v1p2beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Property message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.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.vision.v1p2beta1.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.uint64Value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Property message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Property.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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (!$util.isInteger(message.uint64Value) && !(message.uint64Value && $util.isInteger(message.uint64Value.low) && $util.isInteger(message.uint64Value.high))) + return "uint64Value: integer|Long expected"; + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Property) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.uint64Value != null) + if ($util.Long) + (message.uint64Value = $util.Long.fromValue(object.uint64Value)).unsigned = true; + else if (typeof object.uint64Value === "string") + message.uint64Value = parseInt(object.uint64Value, 10); + else if (typeof object.uint64Value === "number") + message.uint64Value = object.uint64Value; + else if (typeof object.uint64Value === "object") + message.uint64Value = new $util.LongBits(object.uint64Value.low >>> 0, object.uint64Value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Property + * @static + * @param {google.cloud.vision.v1p2beta1.Property} message Property + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Property.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.uint64Value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.uint64Value = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (typeof message.uint64Value === "number") + object.uint64Value = options.longs === String ? String(message.uint64Value) : message.uint64Value; + else + object.uint64Value = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Value) : options.longs === Number ? new $util.LongBits(message.uint64Value.low >>> 0, message.uint64Value.high >>> 0).toNumber(true) : message.uint64Value; + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Property + * @instance + * @returns {Object.} JSON object + */ + Property.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Property; + })(); + + v1p2beta1.EntityAnnotation = (function() { + + /** + * Properties of an EntityAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IEntityAnnotation + * @property {string|null} [mid] EntityAnnotation mid + * @property {string|null} [locale] EntityAnnotation locale + * @property {string|null} [description] EntityAnnotation description + * @property {number|null} [score] EntityAnnotation score + * @property {number|null} [confidence] EntityAnnotation confidence + * @property {number|null} [topicality] EntityAnnotation topicality + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [boundingPoly] EntityAnnotation boundingPoly + * @property {Array.|null} [locations] EntityAnnotation locations + * @property {Array.|null} [properties] EntityAnnotation properties + */ + + /** + * Constructs a new EntityAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an EntityAnnotation. + * @implements IEntityAnnotation + * @constructor + * @param {google.cloud.vision.v1p2beta1.IEntityAnnotation=} [properties] Properties to set + */ + function EntityAnnotation(properties) { + this.locations = []; + this.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]]; + } + + /** + * EntityAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.mid = ""; + + /** + * EntityAnnotation locale. + * @member {string} locale + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locale = ""; + + /** + * EntityAnnotation description. + * @member {string} description + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.description = ""; + + /** + * EntityAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.score = 0; + + /** + * EntityAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.confidence = 0; + + /** + * EntityAnnotation topicality. + * @member {number} topicality + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.topicality = 0; + + /** + * EntityAnnotation boundingPoly. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.boundingPoly = null; + + /** + * EntityAnnotation locations. + * @member {Array.} locations + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locations = $util.emptyArray; + + /** + * EntityAnnotation properties. + * @member {Array.} properties + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.properties = $util.emptyArray; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IEntityAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.EntityAnnotation} EntityAnnotation instance + */ + EntityAnnotation.create = function create(properties) { + return new EntityAnnotation(properties); + }; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.EntityAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.locale != null && message.hasOwnProperty("locale")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.locale); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.topicality != null && message.hasOwnProperty("topicality")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicality); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.vision.v1p2beta1.LocationInfo.encode(message.locations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.vision.v1p2beta1.Property.encode(message.properties[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.EntityAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.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.vision.v1p2beta1.EntityAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.locale = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.confidence = reader.float(); + break; + case 6: + message.topicality = reader.float(); + break; + case 7: + message.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.vision.v1p2beta1.LocationInfo.decode(reader, reader.uint32())); + break; + case 9: + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.vision.v1p2beta1.Property.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.locale != null && message.hasOwnProperty("locale")) + if (!$util.isString(message.locale)) + return "locale: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.topicality != null && message.hasOwnProperty("topicality")) + if (typeof message.topicality !== "number") + return "topicality: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.LocationInfo.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates an EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.EntityAnnotation} EntityAnnotation + */ + EntityAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.EntityAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.EntityAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.locale != null) + message.locale = String(object.locale); + if (object.description != null) + message.description = String(object.description); + if (object.score != null) + message.score = Number(object.score); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.topicality != null) + message.topicality = Number(object.topicality); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.EntityAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.vision.v1p2beta1.EntityAnnotation.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.EntityAnnotation.locations: object expected"); + message.locations[i] = $root.google.cloud.vision.v1p2beta1.LocationInfo.fromObject(object.locations[i]); + } + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.vision.v1p2beta1.EntityAnnotation.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.EntityAnnotation.properties: object expected"); + message.properties[i] = $root.google.cloud.vision.v1p2beta1.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.EntityAnnotation} message EntityAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locations = []; + object.properties = []; + } + if (options.defaults) { + object.mid = ""; + object.locale = ""; + object.description = ""; + object.score = 0; + object.confidence = 0; + object.topicality = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.locale != null && message.hasOwnProperty("locale")) + object.locale = message.locale; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.topicality != null && message.hasOwnProperty("topicality")) + object.topicality = options.json && !isFinite(message.topicality) ? String(message.topicality) : message.topicality; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.vision.v1p2beta1.LocationInfo.toObject(message.locations[j], options); + } + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.vision.v1p2beta1.Property.toObject(message.properties[j], options); + } + return object; + }; + + /** + * Converts this EntityAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.EntityAnnotation + * @instance + * @returns {Object.} JSON object + */ + EntityAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EntityAnnotation; + })(); + + v1p2beta1.SafeSearchAnnotation = (function() { + + /** + * Properties of a SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ISafeSearchAnnotation + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [adult] SafeSearchAnnotation adult + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [spoof] SafeSearchAnnotation spoof + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [medical] SafeSearchAnnotation medical + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [violence] SafeSearchAnnotation violence + * @property {google.cloud.vision.v1p2beta1.Likelihood|null} [racy] SafeSearchAnnotation racy + */ + + /** + * Constructs a new SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a SafeSearchAnnotation. + * @implements ISafeSearchAnnotation + * @constructor + * @param {google.cloud.vision.v1p2beta1.ISafeSearchAnnotation=} [properties] Properties to set + */ + function SafeSearchAnnotation(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]]; + } + + /** + * SafeSearchAnnotation adult. + * @member {google.cloud.vision.v1p2beta1.Likelihood} adult + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.adult = 0; + + /** + * SafeSearchAnnotation spoof. + * @member {google.cloud.vision.v1p2beta1.Likelihood} spoof + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.spoof = 0; + + /** + * SafeSearchAnnotation medical. + * @member {google.cloud.vision.v1p2beta1.Likelihood} medical + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.medical = 0; + + /** + * SafeSearchAnnotation violence. + * @member {google.cloud.vision.v1p2beta1.Likelihood} violence + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.violence = 0; + + /** + * SafeSearchAnnotation racy. + * @member {google.cloud.vision.v1p2beta1.Likelihood} racy + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.racy = 0; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ISafeSearchAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.SafeSearchAnnotation} SafeSearchAnnotation instance + */ + SafeSearchAnnotation.create = function create(properties) { + return new SafeSearchAnnotation(properties); + }; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adult != null && message.hasOwnProperty("adult")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.adult); + if (message.spoof != null && message.hasOwnProperty("spoof")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.spoof); + if (message.medical != null && message.hasOwnProperty("medical")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.medical); + if (message.violence != null && message.hasOwnProperty("violence")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.violence); + if (message.racy != null && message.hasOwnProperty("racy")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.racy); + return writer; + }; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.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.vision.v1p2beta1.SafeSearchAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.adult = reader.int32(); + break; + case 2: + message.spoof = reader.int32(); + break; + case 3: + message.medical = reader.int32(); + break; + case 4: + message.violence = reader.int32(); + break; + case 9: + message.racy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafeSearchAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafeSearchAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adult != null && message.hasOwnProperty("adult")) + switch (message.adult) { + default: + return "adult: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.spoof != null && message.hasOwnProperty("spoof")) + switch (message.spoof) { + default: + return "spoof: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.medical != null && message.hasOwnProperty("medical")) + switch (message.medical) { + default: + return "medical: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.violence != null && message.hasOwnProperty("violence")) + switch (message.violence) { + default: + return "violence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.racy != null && message.hasOwnProperty("racy")) + switch (message.racy) { + default: + return "racy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.SafeSearchAnnotation} SafeSearchAnnotation + */ + SafeSearchAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.SafeSearchAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.SafeSearchAnnotation(); + switch (object.adult) { + case "UNKNOWN": + case 0: + message.adult = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.adult = 1; + break; + case "UNLIKELY": + case 2: + message.adult = 2; + break; + case "POSSIBLE": + case 3: + message.adult = 3; + break; + case "LIKELY": + case 4: + message.adult = 4; + break; + case "VERY_LIKELY": + case 5: + message.adult = 5; + break; + } + switch (object.spoof) { + case "UNKNOWN": + case 0: + message.spoof = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.spoof = 1; + break; + case "UNLIKELY": + case 2: + message.spoof = 2; + break; + case "POSSIBLE": + case 3: + message.spoof = 3; + break; + case "LIKELY": + case 4: + message.spoof = 4; + break; + case "VERY_LIKELY": + case 5: + message.spoof = 5; + break; + } + switch (object.medical) { + case "UNKNOWN": + case 0: + message.medical = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.medical = 1; + break; + case "UNLIKELY": + case 2: + message.medical = 2; + break; + case "POSSIBLE": + case 3: + message.medical = 3; + break; + case "LIKELY": + case 4: + message.medical = 4; + break; + case "VERY_LIKELY": + case 5: + message.medical = 5; + break; + } + switch (object.violence) { + case "UNKNOWN": + case 0: + message.violence = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.violence = 1; + break; + case "UNLIKELY": + case 2: + message.violence = 2; + break; + case "POSSIBLE": + case 3: + message.violence = 3; + break; + case "LIKELY": + case 4: + message.violence = 4; + break; + case "VERY_LIKELY": + case 5: + message.violence = 5; + break; + } + switch (object.racy) { + case "UNKNOWN": + case 0: + message.racy = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.racy = 1; + break; + case "UNLIKELY": + case 2: + message.racy = 2; + break; + case "POSSIBLE": + case 3: + message.racy = 3; + break; + case "LIKELY": + case 4: + message.racy = 4; + break; + case "VERY_LIKELY": + case 5: + message.racy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.SafeSearchAnnotation} message SafeSearchAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafeSearchAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adult = options.enums === String ? "UNKNOWN" : 0; + object.spoof = options.enums === String ? "UNKNOWN" : 0; + object.medical = options.enums === String ? "UNKNOWN" : 0; + object.violence = options.enums === String ? "UNKNOWN" : 0; + object.racy = options.enums === String ? "UNKNOWN" : 0; + } + if (message.adult != null && message.hasOwnProperty("adult")) + object.adult = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.adult] : message.adult; + if (message.spoof != null && message.hasOwnProperty("spoof")) + object.spoof = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.spoof] : message.spoof; + if (message.medical != null && message.hasOwnProperty("medical")) + object.medical = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.medical] : message.medical; + if (message.violence != null && message.hasOwnProperty("violence")) + object.violence = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.violence] : message.violence; + if (message.racy != null && message.hasOwnProperty("racy")) + object.racy = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Likelihood[message.racy] : message.racy; + return object; + }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.SafeSearchAnnotation + * @instance + * @returns {Object.} JSON object + */ + SafeSearchAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SafeSearchAnnotation; + })(); + + v1p2beta1.LatLongRect = (function() { + + /** + * Properties of a LatLongRect. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ILatLongRect + * @property {google.type.ILatLng|null} [minLatLng] LatLongRect minLatLng + * @property {google.type.ILatLng|null} [maxLatLng] LatLongRect maxLatLng + */ + + /** + * Constructs a new LatLongRect. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a LatLongRect. + * @implements ILatLongRect + * @constructor + * @param {google.cloud.vision.v1p2beta1.ILatLongRect=} [properties] Properties to set + */ + function LatLongRect(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]]; + } + + /** + * LatLongRect minLatLng. + * @member {google.type.ILatLng|null|undefined} minLatLng + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.minLatLng = null; + + /** + * LatLongRect maxLatLng. + * @member {google.type.ILatLng|null|undefined} maxLatLng + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.maxLatLng = null; + + /** + * Creates a new LatLongRect instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p2beta1.ILatLongRect=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.LatLongRect} LatLongRect instance + */ + LatLongRect.create = function create(properties) { + return new LatLongRect(properties); + }; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p2beta1.LatLongRect.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p2beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + $root.google.type.LatLng.encode(message.minLatLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + $root.google.type.LatLng.encode(message.maxLatLng, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.LatLongRect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p2beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.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.vision.v1p2beta1.LatLongRect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 2: + message.maxLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLongRect message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLongRect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) { + var error = $root.google.type.LatLng.verify(message.minLatLng); + if (error) + return "minLatLng." + error; + } + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) { + var error = $root.google.type.LatLng.verify(message.maxLatLng); + if (error) + return "maxLatLng." + error; + } + return null; + }; + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.LatLongRect} LatLongRect + */ + LatLongRect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.LatLongRect) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.LatLongRect(); + if (object.minLatLng != null) { + if (typeof object.minLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.LatLongRect.minLatLng: object expected"); + message.minLatLng = $root.google.type.LatLng.fromObject(object.minLatLng); + } + if (object.maxLatLng != null) { + if (typeof object.maxLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.LatLongRect.maxLatLng: object expected"); + message.maxLatLng = $root.google.type.LatLng.fromObject(object.maxLatLng); + } + return message; + }; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p2beta1.LatLongRect} message LatLongRect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLongRect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minLatLng = null; + object.maxLatLng = null; + } + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + object.minLatLng = $root.google.type.LatLng.toObject(message.minLatLng, options); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + object.maxLatLng = $root.google.type.LatLng.toObject(message.maxLatLng, options); + return object; + }; + + /** + * Converts this LatLongRect to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.LatLongRect + * @instance + * @returns {Object.} JSON object + */ + LatLongRect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LatLongRect; + })(); + + v1p2beta1.ColorInfo = (function() { + + /** + * Properties of a ColorInfo. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IColorInfo + * @property {google.type.IColor|null} [color] ColorInfo color + * @property {number|null} [score] ColorInfo score + * @property {number|null} [pixelFraction] ColorInfo pixelFraction + */ + + /** + * Constructs a new ColorInfo. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a ColorInfo. + * @implements IColorInfo + * @constructor + * @param {google.cloud.vision.v1p2beta1.IColorInfo=} [properties] Properties to set + */ + function ColorInfo(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]]; + } + + /** + * ColorInfo color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.color = null; + + /** + * ColorInfo score. + * @member {number} score + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.score = 0; + + /** + * ColorInfo pixelFraction. + * @member {number} pixelFraction + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.pixelFraction = 0; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p2beta1.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.ColorInfo} ColorInfo instance + */ + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); + }; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ColorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p2beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.color != null && message.hasOwnProperty("color")) + $root.google.type.Color.encode(message.color, 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); + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.pixelFraction); + return writer; + }; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ColorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p2beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.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.vision.v1p2beta1.ColorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.color = $root.google.type.Color.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pixelFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColorInfo message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + if (typeof message.pixelFraction !== "number") + return "pixelFraction: number expected"; + return null; + }; + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.ColorInfo} ColorInfo + */ + ColorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.ColorInfo) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.ColorInfo(); + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.ColorInfo.color: object expected"); + message.color = $root.google.type.Color.fromObject(object.color); + } + if (object.score != null) + message.score = Number(object.score); + if (object.pixelFraction != null) + message.pixelFraction = Number(object.pixelFraction); + return message; + }; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p2beta1.ColorInfo} message ColorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.color = null; + object.score = 0; + object.pixelFraction = 0; + } + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.type.Color.toObject(message.color, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + object.pixelFraction = options.json && !isFinite(message.pixelFraction) ? String(message.pixelFraction) : message.pixelFraction; + return object; + }; + + /** + * Converts this ColorInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.ColorInfo + * @instance + * @returns {Object.} JSON object + */ + ColorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ColorInfo; + })(); + + v1p2beta1.DominantColorsAnnotation = (function() { + + /** + * Properties of a DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IDominantColorsAnnotation + * @property {Array.|null} [colors] DominantColorsAnnotation colors + */ + + /** + * Constructs a new DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a DominantColorsAnnotation. + * @implements IDominantColorsAnnotation + * @constructor + * @param {google.cloud.vision.v1p2beta1.IDominantColorsAnnotation=} [properties] Properties to set + */ + function DominantColorsAnnotation(properties) { + this.colors = []; + 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]]; + } + + /** + * DominantColorsAnnotation colors. + * @member {Array.} colors + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @instance + */ + DominantColorsAnnotation.prototype.colors = $util.emptyArray; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IDominantColorsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.DominantColorsAnnotation} DominantColorsAnnotation instance + */ + DominantColorsAnnotation.create = function create(properties) { + return new DominantColorsAnnotation(properties); + }; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.colors != null && message.colors.length) + for (var i = 0; i < message.colors.length; ++i) + $root.google.cloud.vision.v1p2beta1.ColorInfo.encode(message.colors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.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.vision.v1p2beta1.DominantColorsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.colors && message.colors.length)) + message.colors = []; + message.colors.push($root.google.cloud.vision.v1p2beta1.ColorInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominantColorsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominantColorsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.colors != null && message.hasOwnProperty("colors")) { + if (!Array.isArray(message.colors)) + return "colors: array expected"; + for (var i = 0; i < message.colors.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.ColorInfo.verify(message.colors[i]); + if (error) + return "colors." + error; + } + } + return null; + }; + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.DominantColorsAnnotation} DominantColorsAnnotation + */ + DominantColorsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.DominantColorsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.DominantColorsAnnotation(); + if (object.colors) { + if (!Array.isArray(object.colors)) + throw TypeError(".google.cloud.vision.v1p2beta1.DominantColorsAnnotation.colors: array expected"); + message.colors = []; + for (var i = 0; i < object.colors.length; ++i) { + if (typeof object.colors[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.DominantColorsAnnotation.colors: object expected"); + message.colors[i] = $root.google.cloud.vision.v1p2beta1.ColorInfo.fromObject(object.colors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.DominantColorsAnnotation} message DominantColorsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominantColorsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.colors = []; + if (message.colors && message.colors.length) { + object.colors = []; + for (var j = 0; j < message.colors.length; ++j) + object.colors[j] = $root.google.cloud.vision.v1p2beta1.ColorInfo.toObject(message.colors[j], options); + } + return object; + }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.DominantColorsAnnotation + * @instance + * @returns {Object.} JSON object + */ + DominantColorsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominantColorsAnnotation; + })(); + + v1p2beta1.ImageProperties = (function() { + + /** + * Properties of an ImageProperties. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IImageProperties + * @property {google.cloud.vision.v1p2beta1.IDominantColorsAnnotation|null} [dominantColors] ImageProperties dominantColors + */ + + /** + * Constructs a new ImageProperties. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an ImageProperties. + * @implements IImageProperties + * @constructor + * @param {google.cloud.vision.v1p2beta1.IImageProperties=} [properties] Properties to set + */ + function ImageProperties(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]]; + } + + /** + * ImageProperties dominantColors. + * @member {google.cloud.vision.v1p2beta1.IDominantColorsAnnotation|null|undefined} dominantColors + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @instance + */ + ImageProperties.prototype.dominantColors = null; + + /** + * Creates a new ImageProperties instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p2beta1.IImageProperties=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.ImageProperties} ImageProperties instance + */ + ImageProperties.create = function create(properties) { + return new ImageProperties(properties); + }; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p2beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + $root.google.cloud.vision.v1p2beta1.DominantColorsAnnotation.encode(message.dominantColors, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p2beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.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.vision.v1p2beta1.ImageProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dominantColors = $root.google.cloud.vision.v1p2beta1.DominantColorsAnnotation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageProperties message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) { + var error = $root.google.cloud.vision.v1p2beta1.DominantColorsAnnotation.verify(message.dominantColors); + if (error) + return "dominantColors." + error; + } + return null; + }; + + /** + * Creates an ImageProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.ImageProperties} ImageProperties + */ + ImageProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.ImageProperties) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.ImageProperties(); + if (object.dominantColors != null) { + if (typeof object.dominantColors !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.ImageProperties.dominantColors: object expected"); + message.dominantColors = $root.google.cloud.vision.v1p2beta1.DominantColorsAnnotation.fromObject(object.dominantColors); + } + return message; + }; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p2beta1.ImageProperties} message ImageProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dominantColors = null; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + object.dominantColors = $root.google.cloud.vision.v1p2beta1.DominantColorsAnnotation.toObject(message.dominantColors, options); + return object; + }; + + /** + * Converts this ImageProperties to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.ImageProperties + * @instance + * @returns {Object.} JSON object + */ + ImageProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageProperties; + })(); + + v1p2beta1.CropHint = (function() { + + /** + * Properties of a CropHint. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ICropHint + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [boundingPoly] CropHint boundingPoly + * @property {number|null} [confidence] CropHint confidence + * @property {number|null} [importanceFraction] CropHint importanceFraction + */ + + /** + * Constructs a new CropHint. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a CropHint. + * @implements ICropHint + * @constructor + * @param {google.cloud.vision.v1p2beta1.ICropHint=} [properties] Properties to set + */ + function CropHint(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]]; + } + + /** + * CropHint boundingPoly. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @instance + */ + CropHint.prototype.boundingPoly = null; + + /** + * CropHint confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @instance + */ + CropHint.prototype.confidence = 0; + + /** + * CropHint importanceFraction. + * @member {number} importanceFraction + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @instance + */ + CropHint.prototype.importanceFraction = 0; + + /** + * Creates a new CropHint instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHint=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.CropHint} CropHint instance + */ + CropHint.create = function create(properties) { + return new CropHint(properties); + }; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHint.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.importanceFraction); + return writer; + }; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.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.vision.v1p2beta1.CropHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.importanceFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHint message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + if (typeof message.importanceFraction !== "number") + return "importanceFraction: number expected"; + return null; + }; + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.CropHint} CropHint + */ + CropHint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.CropHint) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.CropHint(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.CropHint.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.importanceFraction != null) + message.importanceFraction = Number(object.importanceFraction); + return message; + }; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @static + * @param {google.cloud.vision.v1p2beta1.CropHint} message CropHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingPoly = null; + object.confidence = 0; + object.importanceFraction = 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + object.importanceFraction = options.json && !isFinite(message.importanceFraction) ? String(message.importanceFraction) : message.importanceFraction; + return object; + }; + + /** + * Converts this CropHint to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.CropHint + * @instance + * @returns {Object.} JSON object + */ + CropHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHint; + })(); + + v1p2beta1.CropHintsAnnotation = (function() { + + /** + * Properties of a CropHintsAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ICropHintsAnnotation + * @property {Array.|null} [cropHints] CropHintsAnnotation cropHints + */ + + /** + * Constructs a new CropHintsAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a CropHintsAnnotation. + * @implements ICropHintsAnnotation + * @constructor + * @param {google.cloud.vision.v1p2beta1.ICropHintsAnnotation=} [properties] Properties to set + */ + function CropHintsAnnotation(properties) { + this.cropHints = []; + 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]]; + } + + /** + * CropHintsAnnotation cropHints. + * @member {Array.} cropHints + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @instance + */ + CropHintsAnnotation.prototype.cropHints = $util.emptyArray; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHintsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.CropHintsAnnotation} CropHintsAnnotation instance + */ + CropHintsAnnotation.create = function create(properties) { + return new CropHintsAnnotation(properties); + }; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cropHints != null && message.cropHints.length) + for (var i = 0; i < message.cropHints.length; ++i) + $root.google.cloud.vision.v1p2beta1.CropHint.encode(message.cropHints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.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.vision.v1p2beta1.CropHintsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cropHints && message.cropHints.length)) + message.cropHints = []; + message.cropHints.push($root.google.cloud.vision.v1p2beta1.CropHint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cropHints != null && message.hasOwnProperty("cropHints")) { + if (!Array.isArray(message.cropHints)) + return "cropHints: array expected"; + for (var i = 0; i < message.cropHints.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.CropHint.verify(message.cropHints[i]); + if (error) + return "cropHints." + error; + } + } + return null; + }; + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.CropHintsAnnotation} CropHintsAnnotation + */ + CropHintsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.CropHintsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.CropHintsAnnotation(); + if (object.cropHints) { + if (!Array.isArray(object.cropHints)) + throw TypeError(".google.cloud.vision.v1p2beta1.CropHintsAnnotation.cropHints: array expected"); + message.cropHints = []; + for (var i = 0; i < object.cropHints.length; ++i) { + if (typeof object.cropHints[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.CropHintsAnnotation.cropHints: object expected"); + message.cropHints[i] = $root.google.cloud.vision.v1p2beta1.CropHint.fromObject(object.cropHints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.CropHintsAnnotation} message CropHintsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cropHints = []; + if (message.cropHints && message.cropHints.length) { + object.cropHints = []; + for (var j = 0; j < message.cropHints.length; ++j) + object.cropHints[j] = $root.google.cloud.vision.v1p2beta1.CropHint.toObject(message.cropHints[j], options); + } + return object; + }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.CropHintsAnnotation + * @instance + * @returns {Object.} JSON object + */ + CropHintsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsAnnotation; + })(); + + v1p2beta1.CropHintsParams = (function() { + + /** + * Properties of a CropHintsParams. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ICropHintsParams + * @property {Array.|null} [aspectRatios] CropHintsParams aspectRatios + */ + + /** + * Constructs a new CropHintsParams. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a CropHintsParams. + * @implements ICropHintsParams + * @constructor + * @param {google.cloud.vision.v1p2beta1.ICropHintsParams=} [properties] Properties to set + */ + function CropHintsParams(properties) { + this.aspectRatios = []; + 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]]; + } + + /** + * CropHintsParams aspectRatios. + * @member {Array.} aspectRatios + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @instance + */ + CropHintsParams.prototype.aspectRatios = $util.emptyArray; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHintsParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.CropHintsParams} CropHintsParams instance + */ + CropHintsParams.create = function create(properties) { + return new CropHintsParams(properties); + }; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aspectRatios != null && message.aspectRatios.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.aspectRatios.length; ++i) + writer.float(message.aspectRatios[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.CropHintsParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p2beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.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.vision.v1p2beta1.CropHintsParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.aspectRatios && message.aspectRatios.length)) + message.aspectRatios = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.aspectRatios.push(reader.float()); + } else + message.aspectRatios.push(reader.float()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsParams message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aspectRatios != null && message.hasOwnProperty("aspectRatios")) { + if (!Array.isArray(message.aspectRatios)) + return "aspectRatios: array expected"; + for (var i = 0; i < message.aspectRatios.length; ++i) + if (typeof message.aspectRatios[i] !== "number") + return "aspectRatios: number[] expected"; + } + return null; + }; + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.CropHintsParams} CropHintsParams + */ + CropHintsParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.CropHintsParams) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.CropHintsParams(); + if (object.aspectRatios) { + if (!Array.isArray(object.aspectRatios)) + throw TypeError(".google.cloud.vision.v1p2beta1.CropHintsParams.aspectRatios: array expected"); + message.aspectRatios = []; + for (var i = 0; i < object.aspectRatios.length; ++i) + message.aspectRatios[i] = Number(object.aspectRatios[i]); + } + return message; + }; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p2beta1.CropHintsParams} message CropHintsParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aspectRatios = []; + if (message.aspectRatios && message.aspectRatios.length) { + object.aspectRatios = []; + for (var j = 0; j < message.aspectRatios.length; ++j) + object.aspectRatios[j] = options.json && !isFinite(message.aspectRatios[j]) ? String(message.aspectRatios[j]) : message.aspectRatios[j]; + } + return object; + }; + + /** + * Converts this CropHintsParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.CropHintsParams + * @instance + * @returns {Object.} JSON object + */ + CropHintsParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsParams; + })(); + + v1p2beta1.WebDetectionParams = (function() { + + /** + * Properties of a WebDetectionParams. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IWebDetectionParams + * @property {boolean|null} [includeGeoResults] WebDetectionParams includeGeoResults + */ + + /** + * Constructs a new WebDetectionParams. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a WebDetectionParams. + * @implements IWebDetectionParams + * @constructor + * @param {google.cloud.vision.v1p2beta1.IWebDetectionParams=} [properties] Properties to set + */ + function WebDetectionParams(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]]; + } + + /** + * WebDetectionParams includeGeoResults. + * @member {boolean} includeGeoResults + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @instance + */ + WebDetectionParams.prototype.includeGeoResults = false; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p2beta1.IWebDetectionParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.WebDetectionParams} WebDetectionParams instance + */ + WebDetectionParams.create = function create(properties) { + return new WebDetectionParams(properties); + }; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p2beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeGeoResults); + return writer; + }; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p2beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.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.vision.v1p2beta1.WebDetectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.includeGeoResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetectionParams message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetectionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + if (typeof message.includeGeoResults !== "boolean") + return "includeGeoResults: boolean expected"; + return null; + }; + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.WebDetectionParams} WebDetectionParams + */ + WebDetectionParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.WebDetectionParams) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.WebDetectionParams(); + if (object.includeGeoResults != null) + message.includeGeoResults = Boolean(object.includeGeoResults); + return message; + }; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetectionParams} message WebDetectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.includeGeoResults = false; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + object.includeGeoResults = message.includeGeoResults; + return object; + }; + + /** + * Converts this WebDetectionParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.WebDetectionParams + * @instance + * @returns {Object.} JSON object + */ + WebDetectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebDetectionParams; + })(); + + v1p2beta1.ImageContext = (function() { + + /** + * Properties of an ImageContext. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IImageContext + * @property {google.cloud.vision.v1p2beta1.ILatLongRect|null} [latLongRect] ImageContext latLongRect + * @property {Array.|null} [languageHints] ImageContext languageHints + * @property {google.cloud.vision.v1p2beta1.ICropHintsParams|null} [cropHintsParams] ImageContext cropHintsParams + * @property {google.cloud.vision.v1p2beta1.IWebDetectionParams|null} [webDetectionParams] ImageContext webDetectionParams + */ + + /** + * Constructs a new ImageContext. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an ImageContext. + * @implements IImageContext + * @constructor + * @param {google.cloud.vision.v1p2beta1.IImageContext=} [properties] Properties to set + */ + function ImageContext(properties) { + this.languageHints = []; + 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]]; + } + + /** + * ImageContext latLongRect. + * @member {google.cloud.vision.v1p2beta1.ILatLongRect|null|undefined} latLongRect + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @instance + */ + ImageContext.prototype.latLongRect = null; + + /** + * ImageContext languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @instance + */ + ImageContext.prototype.languageHints = $util.emptyArray; + + /** + * ImageContext cropHintsParams. + * @member {google.cloud.vision.v1p2beta1.ICropHintsParams|null|undefined} cropHintsParams + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @instance + */ + ImageContext.prototype.cropHintsParams = null; + + /** + * ImageContext webDetectionParams. + * @member {google.cloud.vision.v1p2beta1.IWebDetectionParams|null|undefined} webDetectionParams + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @instance + */ + ImageContext.prototype.webDetectionParams = null; + + /** + * Creates a new ImageContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p2beta1.IImageContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.ImageContext} ImageContext instance + */ + ImageContext.create = function create(properties) { + return new ImageContext(properties); + }; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p2beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + $root.google.cloud.vision.v1p2beta1.LatLongRect.encode(message.latLongRect, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageHints[i]); + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + $root.google.cloud.vision.v1p2beta1.CropHintsParams.encode(message.cropHintsParams, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + $root.google.cloud.vision.v1p2beta1.WebDetectionParams.encode(message.webDetectionParams, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p2beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.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.vision.v1p2beta1.ImageContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLongRect = $root.google.cloud.vision.v1p2beta1.LatLongRect.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + case 4: + message.cropHintsParams = $root.google.cloud.vision.v1p2beta1.CropHintsParams.decode(reader, reader.uint32()); + break; + case 6: + message.webDetectionParams = $root.google.cloud.vision.v1p2beta1.WebDetectionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageContext message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) { + var error = $root.google.cloud.vision.v1p2beta1.LatLongRect.verify(message.latLongRect); + if (error) + return "latLongRect." + error; + } + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) { + var error = $root.google.cloud.vision.v1p2beta1.CropHintsParams.verify(message.cropHintsParams); + if (error) + return "cropHintsParams." + error; + } + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetectionParams.verify(message.webDetectionParams); + if (error) + return "webDetectionParams." + error; + } + return null; + }; + + /** + * Creates an ImageContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.ImageContext} ImageContext + */ + ImageContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.ImageContext) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.ImageContext(); + if (object.latLongRect != null) { + if (typeof object.latLongRect !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.ImageContext.latLongRect: object expected"); + message.latLongRect = $root.google.cloud.vision.v1p2beta1.LatLongRect.fromObject(object.latLongRect); + } + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.vision.v1p2beta1.ImageContext.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + if (object.cropHintsParams != null) { + if (typeof object.cropHintsParams !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.ImageContext.cropHintsParams: object expected"); + message.cropHintsParams = $root.google.cloud.vision.v1p2beta1.CropHintsParams.fromObject(object.cropHintsParams); + } + if (object.webDetectionParams != null) { + if (typeof object.webDetectionParams !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.ImageContext.webDetectionParams: object expected"); + message.webDetectionParams = $root.google.cloud.vision.v1p2beta1.WebDetectionParams.fromObject(object.webDetectionParams); + } + return message; + }; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p2beta1.ImageContext} message ImageContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (options.defaults) { + object.latLongRect = null; + object.cropHintsParams = null; + object.webDetectionParams = null; + } + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + object.latLongRect = $root.google.cloud.vision.v1p2beta1.LatLongRect.toObject(message.latLongRect, options); + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + object.cropHintsParams = $root.google.cloud.vision.v1p2beta1.CropHintsParams.toObject(message.cropHintsParams, options); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + object.webDetectionParams = $root.google.cloud.vision.v1p2beta1.WebDetectionParams.toObject(message.webDetectionParams, options); + return object; + }; + + /** + * Converts this ImageContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.ImageContext + * @instance + * @returns {Object.} JSON object + */ + ImageContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageContext; + })(); + + v1p2beta1.AnnotateImageRequest = (function() { + + /** + * Properties of an AnnotateImageRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IAnnotateImageRequest + * @property {google.cloud.vision.v1p2beta1.IImage|null} [image] AnnotateImageRequest image + * @property {Array.|null} [features] AnnotateImageRequest features + * @property {google.cloud.vision.v1p2beta1.IImageContext|null} [imageContext] AnnotateImageRequest imageContext + */ + + /** + * Constructs a new AnnotateImageRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an AnnotateImageRequest. + * @implements IAnnotateImageRequest + * @constructor + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageRequest=} [properties] Properties to set + */ + function AnnotateImageRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AnnotateImageRequest image. + * @member {google.cloud.vision.v1p2beta1.IImage|null|undefined} image + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.image = null; + + /** + * AnnotateImageRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateImageRequest imageContext. + * @member {google.cloud.vision.v1p2beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.imageContext = null; + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageRequest} AnnotateImageRequest instance + */ + AnnotateImageRequest.create = function create(properties) { + return new AnnotateImageRequest(properties); + }; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && message.hasOwnProperty("image")) + $root.google.cloud.vision.v1p2beta1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p2beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p2beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.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.vision.v1p2beta1.AnnotateImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = $root.google.cloud.vision.v1p2beta1.Image.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p2beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p2beta1.ImageContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.vision.v1p2beta1.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p2beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageRequest} AnnotateImageRequest + */ + AnnotateImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.AnnotateImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.AnnotateImageRequest(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageRequest.image: object expected"); + message.image = $root.google.cloud.vision.v1p2beta1.Image.fromObject(object.image); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p2beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p2beta1.ImageContext.fromObject(object.imageContext); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p2beta1.AnnotateImageRequest} message AnnotateImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.image = null; + object.imageContext = null; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.vision.v1p2beta1.Image.toObject(message.image, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p2beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p2beta1.ImageContext.toObject(message.imageContext, options); + return object; + }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageRequest; + })(); + + v1p2beta1.ImageAnnotationContext = (function() { + + /** + * Properties of an ImageAnnotationContext. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IImageAnnotationContext + * @property {string|null} [uri] ImageAnnotationContext uri + * @property {number|null} [pageNumber] ImageAnnotationContext pageNumber + */ + + /** + * Constructs a new ImageAnnotationContext. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an ImageAnnotationContext. + * @implements IImageAnnotationContext + * @constructor + * @param {google.cloud.vision.v1p2beta1.IImageAnnotationContext=} [properties] Properties to set + */ + function ImageAnnotationContext(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]]; + } + + /** + * ImageAnnotationContext uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.uri = ""; + + /** + * ImageAnnotationContext pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.pageNumber = 0; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p2beta1.IImageAnnotationContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.ImageAnnotationContext} ImageAnnotationContext instance + */ + ImageAnnotationContext.create = function create(properties) { + return new ImageAnnotationContext(properties); + }; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageAnnotationContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p2beta1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + return writer; + }; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.ImageAnnotationContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p2beta1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.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.vision.v1p2beta1.ImageAnnotationContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + message.pageNumber = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageAnnotationContext message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageAnnotationContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + return null; + }; + + /** + * Creates an ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.ImageAnnotationContext} ImageAnnotationContext + */ + ImageAnnotationContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.ImageAnnotationContext) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.ImageAnnotationContext(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + return message; + }; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p2beta1.ImageAnnotationContext} message ImageAnnotationContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageAnnotationContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.pageNumber = 0; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + return object; + }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.ImageAnnotationContext + * @instance + * @returns {Object.} JSON object + */ + ImageAnnotationContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageAnnotationContext; + })(); + + v1p2beta1.AnnotateImageResponse = (function() { + + /** + * Properties of an AnnotateImageResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IAnnotateImageResponse + * @property {Array.|null} [faceAnnotations] AnnotateImageResponse faceAnnotations + * @property {Array.|null} [landmarkAnnotations] AnnotateImageResponse landmarkAnnotations + * @property {Array.|null} [logoAnnotations] AnnotateImageResponse logoAnnotations + * @property {Array.|null} [labelAnnotations] AnnotateImageResponse labelAnnotations + * @property {Array.|null} [textAnnotations] AnnotateImageResponse textAnnotations + * @property {google.cloud.vision.v1p2beta1.ITextAnnotation|null} [fullTextAnnotation] AnnotateImageResponse fullTextAnnotation + * @property {google.cloud.vision.v1p2beta1.ISafeSearchAnnotation|null} [safeSearchAnnotation] AnnotateImageResponse safeSearchAnnotation + * @property {google.cloud.vision.v1p2beta1.IImageProperties|null} [imagePropertiesAnnotation] AnnotateImageResponse imagePropertiesAnnotation + * @property {google.cloud.vision.v1p2beta1.ICropHintsAnnotation|null} [cropHintsAnnotation] AnnotateImageResponse cropHintsAnnotation + * @property {google.cloud.vision.v1p2beta1.IWebDetection|null} [webDetection] AnnotateImageResponse webDetection + * @property {google.rpc.IStatus|null} [error] AnnotateImageResponse error + * @property {google.cloud.vision.v1p2beta1.IImageAnnotationContext|null} [context] AnnotateImageResponse context + */ + + /** + * Constructs a new AnnotateImageResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an AnnotateImageResponse. + * @implements IAnnotateImageResponse + * @constructor + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageResponse=} [properties] Properties to set + */ + function AnnotateImageResponse(properties) { + this.faceAnnotations = []; + this.landmarkAnnotations = []; + this.logoAnnotations = []; + this.labelAnnotations = []; + this.textAnnotations = []; + 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]]; + } + + /** + * AnnotateImageResponse faceAnnotations. + * @member {Array.} faceAnnotations + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.faceAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse landmarkAnnotations. + * @member {Array.} landmarkAnnotations + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.landmarkAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse logoAnnotations. + * @member {Array.} logoAnnotations + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.logoAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse labelAnnotations. + * @member {Array.} labelAnnotations + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.labelAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.textAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse fullTextAnnotation. + * @member {google.cloud.vision.v1p2beta1.ITextAnnotation|null|undefined} fullTextAnnotation + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.fullTextAnnotation = null; + + /** + * AnnotateImageResponse safeSearchAnnotation. + * @member {google.cloud.vision.v1p2beta1.ISafeSearchAnnotation|null|undefined} safeSearchAnnotation + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.safeSearchAnnotation = null; + + /** + * AnnotateImageResponse imagePropertiesAnnotation. + * @member {google.cloud.vision.v1p2beta1.IImageProperties|null|undefined} imagePropertiesAnnotation + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.imagePropertiesAnnotation = null; + + /** + * AnnotateImageResponse cropHintsAnnotation. + * @member {google.cloud.vision.v1p2beta1.ICropHintsAnnotation|null|undefined} cropHintsAnnotation + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.cropHintsAnnotation = null; + + /** + * AnnotateImageResponse webDetection. + * @member {google.cloud.vision.v1p2beta1.IWebDetection|null|undefined} webDetection + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.webDetection = null; + + /** + * AnnotateImageResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.error = null; + + /** + * AnnotateImageResponse context. + * @member {google.cloud.vision.v1p2beta1.IImageAnnotationContext|null|undefined} context + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.context = null; + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageResponse} AnnotateImageResponse instance + */ + AnnotateImageResponse.create = function create(properties) { + return new AnnotateImageResponse(properties); + }; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faceAnnotations != null && message.faceAnnotations.length) + for (var i = 0; i < message.faceAnnotations.length; ++i) + $root.google.cloud.vision.v1p2beta1.FaceAnnotation.encode(message.faceAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.landmarkAnnotations != null && message.landmarkAnnotations.length) + for (var i = 0; i < message.landmarkAnnotations.length; ++i) + $root.google.cloud.vision.v1p2beta1.EntityAnnotation.encode(message.landmarkAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.logoAnnotations != null && message.logoAnnotations.length) + for (var i = 0; i < message.logoAnnotations.length; ++i) + $root.google.cloud.vision.v1p2beta1.EntityAnnotation.encode(message.logoAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labelAnnotations != null && message.labelAnnotations.length) + for (var i = 0; i < message.labelAnnotations.length; ++i) + $root.google.cloud.vision.v1p2beta1.EntityAnnotation.encode(message.labelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.vision.v1p2beta1.EntityAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + $root.google.cloud.vision.v1p2beta1.SafeSearchAnnotation.encode(message.safeSearchAnnotation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + $root.google.cloud.vision.v1p2beta1.ImageProperties.encode(message.imagePropertiesAnnotation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + $root.google.cloud.vision.v1p2beta1.CropHintsAnnotation.encode(message.cropHintsAnnotation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.encode(message.fullTextAnnotation, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + $root.google.cloud.vision.v1p2beta1.WebDetection.encode(message.webDetection, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.context != null && message.hasOwnProperty("context")) + $root.google.cloud.vision.v1p2beta1.ImageAnnotationContext.encode(message.context, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateImageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.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.vision.v1p2beta1.AnnotateImageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.faceAnnotations && message.faceAnnotations.length)) + message.faceAnnotations = []; + message.faceAnnotations.push($root.google.cloud.vision.v1p2beta1.FaceAnnotation.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.landmarkAnnotations && message.landmarkAnnotations.length)) + message.landmarkAnnotations = []; + message.landmarkAnnotations.push($root.google.cloud.vision.v1p2beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.logoAnnotations && message.logoAnnotations.length)) + message.logoAnnotations = []; + message.logoAnnotations.push($root.google.cloud.vision.v1p2beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.labelAnnotations && message.labelAnnotations.length)) + message.labelAnnotations = []; + message.labelAnnotations.push($root.google.cloud.vision.v1p2beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.vision.v1p2beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 12: + message.fullTextAnnotation = $root.google.cloud.vision.v1p2beta1.TextAnnotation.decode(reader, reader.uint32()); + break; + case 6: + message.safeSearchAnnotation = $root.google.cloud.vision.v1p2beta1.SafeSearchAnnotation.decode(reader, reader.uint32()); + break; + case 8: + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p2beta1.ImageProperties.decode(reader, reader.uint32()); + break; + case 11: + message.cropHintsAnnotation = $root.google.cloud.vision.v1p2beta1.CropHintsAnnotation.decode(reader, reader.uint32()); + break; + case 13: + message.webDetection = $root.google.cloud.vision.v1p2beta1.WebDetection.decode(reader, reader.uint32()); + break; + case 9: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 21: + message.context = $root.google.cloud.vision.v1p2beta1.ImageAnnotationContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageResponse message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faceAnnotations != null && message.hasOwnProperty("faceAnnotations")) { + if (!Array.isArray(message.faceAnnotations)) + return "faceAnnotations: array expected"; + for (var i = 0; i < message.faceAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.FaceAnnotation.verify(message.faceAnnotations[i]); + if (error) + return "faceAnnotations." + error; + } + } + if (message.landmarkAnnotations != null && message.hasOwnProperty("landmarkAnnotations")) { + if (!Array.isArray(message.landmarkAnnotations)) + return "landmarkAnnotations: array expected"; + for (var i = 0; i < message.landmarkAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.verify(message.landmarkAnnotations[i]); + if (error) + return "landmarkAnnotations." + error; + } + } + if (message.logoAnnotations != null && message.hasOwnProperty("logoAnnotations")) { + if (!Array.isArray(message.logoAnnotations)) + return "logoAnnotations: array expected"; + for (var i = 0; i < message.logoAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.verify(message.logoAnnotations[i]); + if (error) + return "logoAnnotations." + error; + } + } + if (message.labelAnnotations != null && message.hasOwnProperty("labelAnnotations")) { + if (!Array.isArray(message.labelAnnotations)) + return "labelAnnotations: array expected"; + for (var i = 0; i < message.labelAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.verify(message.labelAnnotations[i]); + if (error) + return "labelAnnotations." + error; + } + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.verify(message.fullTextAnnotation); + if (error) + return "fullTextAnnotation." + error; + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) { + var error = $root.google.cloud.vision.v1p2beta1.SafeSearchAnnotation.verify(message.safeSearchAnnotation); + if (error) + return "safeSearchAnnotation." + error; + } + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) { + var error = $root.google.cloud.vision.v1p2beta1.ImageProperties.verify(message.imagePropertiesAnnotation); + if (error) + return "imagePropertiesAnnotation." + error; + } + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) { + var error = $root.google.cloud.vision.v1p2beta1.CropHintsAnnotation.verify(message.cropHintsAnnotation); + if (error) + return "cropHintsAnnotation." + error; + } + if (message.webDetection != null && message.hasOwnProperty("webDetection")) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.verify(message.webDetection); + if (error) + return "webDetection." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.vision.v1p2beta1.ImageAnnotationContext.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.AnnotateImageResponse} AnnotateImageResponse + */ + AnnotateImageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse(); + if (object.faceAnnotations) { + if (!Array.isArray(object.faceAnnotations)) + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.faceAnnotations: array expected"); + message.faceAnnotations = []; + for (var i = 0; i < object.faceAnnotations.length; ++i) { + if (typeof object.faceAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.faceAnnotations: object expected"); + message.faceAnnotations[i] = $root.google.cloud.vision.v1p2beta1.FaceAnnotation.fromObject(object.faceAnnotations[i]); + } + } + if (object.landmarkAnnotations) { + if (!Array.isArray(object.landmarkAnnotations)) + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.landmarkAnnotations: array expected"); + message.landmarkAnnotations = []; + for (var i = 0; i < object.landmarkAnnotations.length; ++i) { + if (typeof object.landmarkAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.landmarkAnnotations: object expected"); + message.landmarkAnnotations[i] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.fromObject(object.landmarkAnnotations[i]); + } + } + if (object.logoAnnotations) { + if (!Array.isArray(object.logoAnnotations)) + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.logoAnnotations: array expected"); + message.logoAnnotations = []; + for (var i = 0; i < object.logoAnnotations.length; ++i) { + if (typeof object.logoAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.logoAnnotations: object expected"); + message.logoAnnotations[i] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.fromObject(object.logoAnnotations[i]); + } + } + if (object.labelAnnotations) { + if (!Array.isArray(object.labelAnnotations)) + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.labelAnnotations: array expected"); + message.labelAnnotations = []; + for (var i = 0; i < object.labelAnnotations.length; ++i) { + if (typeof object.labelAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.labelAnnotations: object expected"); + message.labelAnnotations[i] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.fromObject(object.labelAnnotations[i]); + } + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.fullTextAnnotation != null) { + if (typeof object.fullTextAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.fullTextAnnotation: object expected"); + message.fullTextAnnotation = $root.google.cloud.vision.v1p2beta1.TextAnnotation.fromObject(object.fullTextAnnotation); + } + if (object.safeSearchAnnotation != null) { + if (typeof object.safeSearchAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.safeSearchAnnotation: object expected"); + message.safeSearchAnnotation = $root.google.cloud.vision.v1p2beta1.SafeSearchAnnotation.fromObject(object.safeSearchAnnotation); + } + if (object.imagePropertiesAnnotation != null) { + if (typeof object.imagePropertiesAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.imagePropertiesAnnotation: object expected"); + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p2beta1.ImageProperties.fromObject(object.imagePropertiesAnnotation); + } + if (object.cropHintsAnnotation != null) { + if (typeof object.cropHintsAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.cropHintsAnnotation: object expected"); + message.cropHintsAnnotation = $root.google.cloud.vision.v1p2beta1.CropHintsAnnotation.fromObject(object.cropHintsAnnotation); + } + if (object.webDetection != null) { + if (typeof object.webDetection !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.webDetection: object expected"); + message.webDetection = $root.google.cloud.vision.v1p2beta1.WebDetection.fromObject(object.webDetection); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateImageResponse.context: object expected"); + message.context = $root.google.cloud.vision.v1p2beta1.ImageAnnotationContext.fromObject(object.context); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p2beta1.AnnotateImageResponse} message AnnotateImageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.faceAnnotations = []; + object.landmarkAnnotations = []; + object.logoAnnotations = []; + object.labelAnnotations = []; + object.textAnnotations = []; + } + if (options.defaults) { + object.safeSearchAnnotation = null; + object.imagePropertiesAnnotation = null; + object.error = null; + object.cropHintsAnnotation = null; + object.fullTextAnnotation = null; + object.webDetection = null; + object.context = null; + } + if (message.faceAnnotations && message.faceAnnotations.length) { + object.faceAnnotations = []; + for (var j = 0; j < message.faceAnnotations.length; ++j) + object.faceAnnotations[j] = $root.google.cloud.vision.v1p2beta1.FaceAnnotation.toObject(message.faceAnnotations[j], options); + } + if (message.landmarkAnnotations && message.landmarkAnnotations.length) { + object.landmarkAnnotations = []; + for (var j = 0; j < message.landmarkAnnotations.length; ++j) + object.landmarkAnnotations[j] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.toObject(message.landmarkAnnotations[j], options); + } + if (message.logoAnnotations && message.logoAnnotations.length) { + object.logoAnnotations = []; + for (var j = 0; j < message.logoAnnotations.length; ++j) + object.logoAnnotations[j] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.toObject(message.logoAnnotations[j], options); + } + if (message.labelAnnotations && message.labelAnnotations.length) { + object.labelAnnotations = []; + for (var j = 0; j < message.labelAnnotations.length; ++j) + object.labelAnnotations[j] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.toObject(message.labelAnnotations[j], options); + } + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.vision.v1p2beta1.EntityAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + object.safeSearchAnnotation = $root.google.cloud.vision.v1p2beta1.SafeSearchAnnotation.toObject(message.safeSearchAnnotation, options); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + object.imagePropertiesAnnotation = $root.google.cloud.vision.v1p2beta1.ImageProperties.toObject(message.imagePropertiesAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + object.cropHintsAnnotation = $root.google.cloud.vision.v1p2beta1.CropHintsAnnotation.toObject(message.cropHintsAnnotation, options); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + object.fullTextAnnotation = $root.google.cloud.vision.v1p2beta1.TextAnnotation.toObject(message.fullTextAnnotation, options); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + object.webDetection = $root.google.cloud.vision.v1p2beta1.WebDetection.toObject(message.webDetection, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.vision.v1p2beta1.ImageAnnotationContext.toObject(message.context, options); + return object; + }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.AnnotateImageResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageResponse; + })(); + + v1p2beta1.AnnotateFileResponse = (function() { + + /** + * Properties of an AnnotateFileResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IAnnotateFileResponse + * @property {google.cloud.vision.v1p2beta1.IInputConfig|null} [inputConfig] AnnotateFileResponse inputConfig + * @property {Array.|null} [responses] AnnotateFileResponse responses + */ + + /** + * Constructs a new AnnotateFileResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an AnnotateFileResponse. + * @implements IAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1p2beta1.IAnnotateFileResponse=} [properties] Properties to set + */ + function AnnotateFileResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AnnotateFileResponse inputConfig. + * @member {google.cloud.vision.v1p2beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.inputConfig = null; + + /** + * AnnotateFileResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.AnnotateFileResponse} AnnotateFileResponse instance + */ + AnnotateFileResponse.create = function create(properties) { + return new AnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p2beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.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.vision.v1p2beta1.AnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1p2beta1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateFileResponse.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.vision.v1p2beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.AnnotateFileResponse} AnnotateFileResponse + */ + AnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.AnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.AnnotateFileResponse(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateFileResponse.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p2beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateFileResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AnnotateFileResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.AnnotateFileResponse} message AnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (options.defaults) + object.inputConfig = null; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p2beta1.InputConfig.toObject(message.inputConfig, options); + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.AnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateFileResponse; + })(); + + v1p2beta1.BatchAnnotateImagesRequest = (function() { + + /** + * Properties of a BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IBatchAnnotateImagesRequest + * @property {Array.|null} [requests] BatchAnnotateImagesRequest requests + */ + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a BatchAnnotateImagesRequest. + * @implements IBatchAnnotateImagesRequest + * @constructor + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + */ + function BatchAnnotateImagesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchAnnotateImagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @instance + */ + BatchAnnotateImagesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest instance + */ + BatchAnnotateImagesRequest.create = function create(properties) { + return new BatchAnnotateImagesRequest(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p2beta1.AnnotateImageRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.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.vision.v1p2beta1.BatchAnnotateImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p2beta1.AnnotateImageRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.AnnotateImageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + */ + BatchAnnotateImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p2beta1.AnnotateImageRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest} message BatchAnnotateImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p2beta1.AnnotateImageRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesRequest; + })(); + + v1p2beta1.BatchAnnotateImagesResponse = (function() { + + /** + * Properties of a BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IBatchAnnotateImagesResponse + * @property {Array.|null} [responses] BatchAnnotateImagesResponse responses + */ + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a BatchAnnotateImagesResponse. + * @implements IBatchAnnotateImagesResponse + * @constructor + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + */ + function BatchAnnotateImagesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * BatchAnnotateImagesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @instance + */ + BatchAnnotateImagesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse instance + */ + BatchAnnotateImagesResponse.create = function create(properties) { + return new BatchAnnotateImagesResponse(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.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.vision.v1p2beta1.BatchAnnotateImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + */ + BatchAnnotateImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse} message BatchAnnotateImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p2beta1.AnnotateImageResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesResponse; + })(); + + v1p2beta1.AsyncAnnotateFileRequest = (function() { + + /** + * Properties of an AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IAsyncAnnotateFileRequest + * @property {google.cloud.vision.v1p2beta1.IInputConfig|null} [inputConfig] AsyncAnnotateFileRequest inputConfig + * @property {Array.|null} [features] AsyncAnnotateFileRequest features + * @property {google.cloud.vision.v1p2beta1.IImageContext|null} [imageContext] AsyncAnnotateFileRequest imageContext + * @property {google.cloud.vision.v1p2beta1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileRequest outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an AsyncAnnotateFileRequest. + * @implements IAsyncAnnotateFileRequest + * @constructor + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest=} [properties] Properties to set + */ + function AsyncAnnotateFileRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AsyncAnnotateFileRequest inputConfig. + * @member {google.cloud.vision.v1p2beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.inputConfig = null; + + /** + * AsyncAnnotateFileRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.features = $util.emptyArray; + + /** + * AsyncAnnotateFileRequest imageContext. + * @member {google.cloud.vision.v1p2beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.imageContext = null; + + /** + * AsyncAnnotateFileRequest outputConfig. + * @member {google.cloud.vision.v1p2beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest instance + */ + AsyncAnnotateFileRequest.create = function create(properties) { + return new AsyncAnnotateFileRequest(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p2beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p2beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p2beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.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.vision.v1p2beta1.AsyncAnnotateFileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1p2beta1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p2beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p2beta1.ImageContext.decode(reader, reader.uint32()); + break; + case 4: + message.outputConfig = $root.google.cloud.vision.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileRequest.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.vision.v1p2beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p2beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p2beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + */ + AsyncAnnotateFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p2beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p2beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p2beta1.ImageContext.fromObject(object.imageContext); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p2beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest} message AsyncAnnotateFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputConfig = null; + object.imageContext = null; + object.outputConfig = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p2beta1.InputConfig.toObject(message.inputConfig, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p2beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p2beta1.ImageContext.toObject(message.imageContext, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileRequest; + })(); + + v1p2beta1.AsyncAnnotateFileResponse = (function() { + + /** + * Properties of an AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IAsyncAnnotateFileResponse + * @property {google.cloud.vision.v1p2beta1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileResponse outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an AsyncAnnotateFileResponse. + * @implements IAsyncAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse=} [properties] Properties to set + */ + function AsyncAnnotateFileResponse(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]]; + } + + /** + * AsyncAnnotateFileResponse outputConfig. + * @member {google.cloud.vision.v1p2beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @instance + */ + AsyncAnnotateFileResponse.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse instance + */ + AsyncAnnotateFileResponse.create = function create(properties) { + return new AsyncAnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.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.vision.v1p2beta1.AsyncAnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.vision.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p2beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + */ + AsyncAnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p2beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse} message AsyncAnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileResponse; + })(); + + v1p2beta1.AsyncBatchAnnotateFilesRequest = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IAsyncBatchAnnotateFilesRequest + * @property {Array.|null} [requests] AsyncBatchAnnotateFilesRequest requests + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an AsyncBatchAnnotateFilesRequest. + * @implements IAsyncBatchAnnotateFilesRequest + * @constructor + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @instance + */ + AsyncBatchAnnotateFilesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest instance + */ + AsyncBatchAnnotateFilesRequest.create = function create(properties) { + return new AsyncBatchAnnotateFilesRequest(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.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.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + */ + AsyncBatchAnnotateFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesRequest; + })(); + + v1p2beta1.AsyncBatchAnnotateFilesResponse = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IAsyncBatchAnnotateFilesResponse + * @property {Array.|null} [responses] AsyncBatchAnnotateFilesResponse responses + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an AsyncBatchAnnotateFilesResponse. + * @implements IAsyncBatchAnnotateFilesResponse + * @constructor + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @instance + */ + AsyncBatchAnnotateFilesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse instance + */ + AsyncBatchAnnotateFilesResponse.create = function create(properties) { + return new AsyncBatchAnnotateFilesResponse(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.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.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + */ + AsyncBatchAnnotateFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesResponse; + })(); + + v1p2beta1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IInputConfig + * @property {google.cloud.vision.v1p2beta1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {string|null} [mimeType] InputConfig mimeType + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.vision.v1p2beta1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(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]]; + } + + /** + * InputConfig gcsSource. + * @member {google.cloud.vision.v1p2beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.vision.v1p2beta1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.vision.v1p2beta1.InputConfig + * @instance + */ + InputConfig.prototype.mimeType = ""; + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.v1p2beta1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.vision.v1p2beta1.GcsSource.decode(reader, reader.uint32()); + break; + case 2: + message.mimeType = 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.vision.v1p2beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.vision.v1p2beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: 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.vision.v1p2beta1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.InputConfig) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.vision.v1p2beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.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.defaults) { + object.gcsSource = null; + object.mimeType = ""; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.vision.v1p2beta1.GcsSource.toObject(message.gcsSource, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputConfig; + })(); + + v1p2beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IOutputConfig + * @property {google.cloud.vision.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {number|null} [batchSize] OutputConfig batchSize + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig batchSize. + * @member {number} batchSize + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.batchSize = 0; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.v1p2beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.batchSize); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.vision.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.batchSize = reader.int32(); + 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.vision.v1p2beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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"; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + var error = $root.google.cloud.vision.v1p2beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + if (!$util.isInteger(message.batchSize)) + return "batchSize: integer expected"; + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.OutputConfig) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.vision.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.batchSize != null) + message.batchSize = object.batchSize | 0; + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p2beta1.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 (options.defaults) { + object.gcsDestination = null; + object.batchSize = 0; + } + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + object.gcsDestination = $root.google.cloud.vision.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + object.batchSize = message.batchSize; + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1p2beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IGcsSource + * @property {string|null} [uri] GcsSource uri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.vision.v1p2beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(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]]; + } + + /** + * GcsSource uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p2beta1.GcsSource + * @instance + */ + GcsSource.prototype.uri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p2beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.v1p2beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p2beta1.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1p2beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1p2beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.GcsSource) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.GcsSource(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p2beta1.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.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v1p2beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.vision.v1p2beta1.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 uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p2beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.v1p2beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p2beta1.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1p2beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1p2beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.GcsDestination) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p2beta1.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.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v1p2beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IOperationMetadata + * @property {google.cloud.vision.v1p2beta1.OperationMetadata.State|null} [state] OperationMetadata state + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.vision.v1p2beta1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata state. + * @member {google.cloud.vision.v1p2beta1.OperationMetadata.State} state + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.state = 0; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p2beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p2beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p2beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + 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.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p2beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.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"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.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; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.OperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATED": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p2beta1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vision.v1p2beta1.OperationMetadata.State[message.state] : message.state; + 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); + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.vision.v1p2beta1.OperationMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATED=1 CREATED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + * @property {number} CANCELLED=4 CANCELLED value + */ + OperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return OperationMetadata; + })(); + + /** + * Likelihood enum. + * @name google.cloud.vision.v1p2beta1.Likelihood + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1p2beta1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + v1p2beta1.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.vision.v1p2beta1.IVertex=} [properties] Properties to set + */ + function Vertex(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]]; + } + + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {google.cloud.vision.v1p2beta1.IVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {google.cloud.vision.v1p2beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && message.hasOwnProperty("x")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); + if (message.y != null && message.hasOwnProperty("y")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); + return writer; + }; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {google.cloud.vision.v1p2beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.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.vision.v1p2beta1.Vertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.int32(); + break; + case 2: + message.y = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vertex message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Vertex) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Vertex(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @static + * @param {google.cloud.vision.v1p2beta1.Vertex} message Vertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vertex.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 = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + + /** + * Converts this Vertex to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Vertex + * @instance + * @returns {Object.} JSON object + */ + Vertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vertex; + })(); + + v1p2beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.vision.v1p2beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.vision.v1p2beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p2beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.v1p2beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vision.v1p2beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NormalizedVertex; + })(); + + v1p2beta1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.vision.v1p2beta1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.vertices = []; + 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 vertices. + * @member {Array.} vertices + * @memberof google.cloud.vision.v1p2beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.vision.v1p2beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p2beta1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p2beta1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p2beta1.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.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.vision.v1p2beta1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.vision.v1p2beta1.Vertex.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.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.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + 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.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.BoundingPoly) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.vision.v1p2beta1.BoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.vision.v1p2beta1.Vertex.fromObject(object.vertices[i]); + } + } + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.vision.v1p2beta1.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.vision.v1p2beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p2beta1.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.vertices = []; + object.normalizedVertices = []; + } + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.vision.v1p2beta1.Vertex.toObject(message.vertices[j], options); + } + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.vision.v1p2beta1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoundingPoly; + })(); + + v1p2beta1.Position = (function() { + + /** + * Properties of a Position. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IPosition + * @property {number|null} [x] Position x + * @property {number|null} [y] Position y + * @property {number|null} [z] Position z + */ + + /** + * Constructs a new Position. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Position. + * @implements IPosition + * @constructor + * @param {google.cloud.vision.v1p2beta1.IPosition=} [properties] Properties to set + */ + function Position(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]]; + } + + /** + * Position x. + * @member {number} x + * @memberof google.cloud.vision.v1p2beta1.Position + * @instance + */ + Position.prototype.x = 0; + + /** + * Position y. + * @member {number} y + * @memberof google.cloud.vision.v1p2beta1.Position + * @instance + */ + Position.prototype.y = 0; + + /** + * Position z. + * @member {number} z + * @memberof google.cloud.vision.v1p2beta1.Position + * @instance + */ + Position.prototype.z = 0; + + /** + * Creates a new Position instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {google.cloud.vision.v1p2beta1.IPosition=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Position} Position instance + */ + Position.create = function create(properties) { + return new Position(properties); + }; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Position.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {google.cloud.vision.v1p2beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.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); + if (message.z != null && message.hasOwnProperty("z")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.z); + return writer; + }; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Position.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {google.cloud.vision.v1p2beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Position message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.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.vision.v1p2beta1.Position(); + 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; + case 3: + message.z = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Position message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Position.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"; + if (message.z != null && message.hasOwnProperty("z")) + if (typeof message.z !== "number") + return "z: number expected"; + return null; + }; + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Position} Position + */ + Position.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Position) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Position(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + if (object.z != null) + message.z = Number(object.z); + return message; + }; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Position + * @static + * @param {google.cloud.vision.v1p2beta1.Position} message Position + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Position.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + object.z = 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; + if (message.z != null && message.hasOwnProperty("z")) + object.z = options.json && !isFinite(message.z) ? String(message.z) : message.z; + return object; + }; + + /** + * Converts this Position to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Position + * @instance + * @returns {Object.} JSON object + */ + Position.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Position; + })(); + + v1p2beta1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ITextAnnotation + * @property {Array.|null} [pages] TextAnnotation pages + * @property {string|null} [text] TextAnnotation text + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.vision.v1p2beta1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.pages = []; + 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]]; + } + + /** + * TextAnnotation pages. + * @member {Array.} pages + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.pages = $util.emptyArray; + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.vision.v1p2beta1.Page.encode(message.pages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.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.vision.v1p2beta1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.vision.v1p2beta1.Page.decode(reader, reader.uint32())); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Page.verify(message.pages[i]); + if (error) + return "pages." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.TextAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.TextAnnotation(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.vision.v1p2beta1.TextAnnotation.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.TextAnnotation.pages: object expected"); + message.pages[i] = $root.google.cloud.vision.v1p2beta1.Page.fromObject(object.pages[i]); + } + } + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (options.defaults) + object.text = ""; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.vision.v1p2beta1.Page.toObject(message.pages[j], options); + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TextAnnotation.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(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]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.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.vision.v1p2beta1.TextAnnotation.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectedLanguage; + })(); + + TextAnnotation.DetectedBreak = (function() { + + /** + * Properties of a DetectedBreak. + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @interface IDetectedBreak + * @property {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType|null} [type] DetectedBreak type + * @property {boolean|null} [isPrefix] DetectedBreak isPrefix + */ + + /** + * Constructs a new DetectedBreak. + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @classdesc Represents a DetectedBreak. + * @implements IDetectedBreak + * @constructor + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + */ + function DetectedBreak(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]]; + } + + /** + * DetectedBreak type. + * @member {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType} type + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.type = 0; + + /** + * DetectedBreak isPrefix. + * @member {boolean} isPrefix + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.isPrefix = false; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak} DetectedBreak instance + */ + DetectedBreak.create = function create(properties) { + return new DetectedBreak(properties); + }; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isPrefix); + return writer; + }; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.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.vision.v1p2beta1.TextAnnotation.DetectedBreak(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.isPrefix = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedBreak message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedBreak.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + if (typeof message.isPrefix !== "boolean") + return "isPrefix: boolean expected"; + return null; + }; + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak} DetectedBreak + */ + DetectedBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "SPACE": + case 1: + message.type = 1; + break; + case "SURE_SPACE": + case 2: + message.type = 2; + break; + case "EOL_SURE_SPACE": + case 3: + message.type = 3; + break; + case "HYPHEN": + case 4: + message.type = 4; + break; + case "LINE_BREAK": + case 5: + message.type = 5; + break; + } + if (object.isPrefix != null) + message.isPrefix = Boolean(object.isPrefix); + return message; + }; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak} message DetectedBreak + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedBreak.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.isPrefix = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType[message.type] : message.type; + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + object.isPrefix = message.isPrefix; + return object; + }; + + /** + * Converts this DetectedBreak to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak + * @instance + * @returns {Object.} JSON object + */ + DetectedBreak.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BreakType enum. + * @name google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SPACE=1 SPACE value + * @property {number} SURE_SPACE=2 SURE_SPACE value + * @property {number} EOL_SURE_SPACE=3 EOL_SURE_SPACE value + * @property {number} HYPHEN=4 HYPHEN value + * @property {number} LINE_BREAK=5 LINE_BREAK value + */ + DetectedBreak.BreakType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SPACE"] = 1; + values[valuesById[2] = "SURE_SPACE"] = 2; + values[valuesById[3] = "EOL_SURE_SPACE"] = 3; + values[valuesById[4] = "HYPHEN"] = 4; + values[valuesById[5] = "LINE_BREAK"] = 5; + return values; + })(); + + return DetectedBreak; + })(); + + TextAnnotation.TextProperty = (function() { + + /** + * Properties of a TextProperty. + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @interface ITextProperty + * @property {Array.|null} [detectedLanguages] TextProperty detectedLanguages + * @property {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak|null} [detectedBreak] TextProperty detectedBreak + */ + + /** + * Constructs a new TextProperty. + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation + * @classdesc Represents a TextProperty. + * @implements ITextProperty + * @constructor + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + */ + function TextProperty(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * TextProperty detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedLanguages = $util.emptyArray; + + /** + * TextProperty detectedBreak. + * @member {google.cloud.vision.v1p2beta1.TextAnnotation.IDetectedBreak|null|undefined} detectedBreak + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedBreak = null; + + /** + * Creates a new TextProperty instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty} TextProperty instance + */ + TextProperty.create = function create(properties) { + return new TextProperty(properties); + }; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.encode(message.detectedBreak, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.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.vision.v1p2beta1.TextAnnotation.TextProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.decode(reader, reader.uint32())); + break; + case 2: + message.detectedBreak = $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProperty message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.verify(message.detectedBreak); + if (error) + return "detectedBreak." + error; + } + return null; + }; + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty} TextProperty + */ + TextProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty(); + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.detectedBreak != null) { + if (typeof object.detectedBreak !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.detectedBreak: object expected"); + message.detectedBreak = $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.fromObject(object.detectedBreak); + } + return message; + }; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty} message TextProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) + object.detectedBreak = null; + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + object.detectedBreak = $root.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.toObject(message.detectedBreak, options); + return object; + }; + + /** + * Converts this TextProperty to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty + * @instance + * @returns {Object.} JSON object + */ + TextProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProperty; + })(); + + return TextAnnotation; + })(); + + v1p2beta1.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IPage + * @property {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null} [property] Page property + * @property {number|null} [width] Page width + * @property {number|null} [height] Page height + * @property {Array.|null} [blocks] Page blocks + * @property {number|null} [confidence] Page confidence + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.vision.v1p2beta1.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.blocks = []; + 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]]; + } + + /** + * Page property. + * @member {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p2beta1.Page + * @instance + */ + Page.prototype.property = null; + + /** + * Page width. + * @member {number} width + * @memberof google.cloud.vision.v1p2beta1.Page + * @instance + */ + Page.prototype.width = 0; + + /** + * Page height. + * @member {number} height + * @memberof google.cloud.vision.v1p2beta1.Page + * @instance + */ + Page.prototype.height = 0; + + /** + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.vision.v1p2beta1.Page + * @instance + */ + Page.prototype.blocks = $util.emptyArray; + + /** + * Page confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.Page + * @instance + */ + Page.prototype.confidence = 0; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {google.cloud.vision.v1p2beta1.IPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {google.cloud.vision.v1p2beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.width != null && message.hasOwnProperty("width")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.width); + if (message.height != null && message.hasOwnProperty("height")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.height); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.vision.v1p2beta1.Block.encode(message.blocks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {google.cloud.vision.v1p2beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.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.vision.v1p2beta1.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.width = reader.int32(); + break; + case 3: + message.height = reader.int32(); + break; + case 4: + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.vision.v1p2beta1.Block.decode(reader, reader.uint32())); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Block.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Page) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Page(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Page.property: object expected"); + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.vision.v1p2beta1.Page.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Page.blocks: object expected"); + message.blocks[i] = $root.google.cloud.vision.v1p2beta1.Block.fromObject(object.blocks[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Page + * @static + * @param {google.cloud.vision.v1p2beta1.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (options.defaults) { + object.property = null; + object.width = 0; + object.height = 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.vision.v1p2beta1.Block.toObject(message.blocks[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Page; + })(); + + v1p2beta1.Block = (function() { + + /** + * Properties of a Block. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IBlock + * @property {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null} [property] Block property + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [boundingBox] Block boundingBox + * @property {Array.|null} [paragraphs] Block paragraphs + * @property {google.cloud.vision.v1p2beta1.Block.BlockType|null} [blockType] Block blockType + * @property {number|null} [confidence] Block confidence + */ + + /** + * Constructs a new Block. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {google.cloud.vision.v1p2beta1.IBlock=} [properties] Properties to set + */ + function Block(properties) { + this.paragraphs = []; + 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]]; + } + + /** + * Block property. + * @member {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p2beta1.Block + * @instance + */ + Block.prototype.property = null; + + /** + * Block boundingBox. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p2beta1.Block + * @instance + */ + Block.prototype.boundingBox = null; + + /** + * Block paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.vision.v1p2beta1.Block + * @instance + */ + Block.prototype.paragraphs = $util.emptyArray; + + /** + * Block blockType. + * @member {google.cloud.vision.v1p2beta1.Block.BlockType} blockType + * @memberof google.cloud.vision.v1p2beta1.Block + * @instance + */ + Block.prototype.blockType = 0; + + /** + * Block confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.Block + * @instance + */ + Block.prototype.confidence = 0; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {google.cloud.vision.v1p2beta1.IBlock=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Block.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {google.cloud.vision.v1p2beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paragraphs != null && message.paragraphs.length) + for (var i = 0; i < message.paragraphs.length; ++i) + $root.google.cloud.vision.v1p2beta1.Paragraph.encode(message.paragraphs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.blockType != null && message.hasOwnProperty("blockType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.blockType); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {google.cloud.vision.v1p2beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.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.vision.v1p2beta1.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.paragraphs && message.paragraphs.length)) + message.paragraphs = []; + message.paragraphs.push($root.google.cloud.vision.v1p2beta1.Paragraph.decode(reader, reader.uint32())); + break; + case 4: + message.blockType = reader.int32(); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.paragraphs != null && message.hasOwnProperty("paragraphs")) { + if (!Array.isArray(message.paragraphs)) + return "paragraphs: array expected"; + for (var i = 0; i < message.paragraphs.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Paragraph.verify(message.paragraphs[i]); + if (error) + return "paragraphs." + error; + } + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + switch (message.blockType) { + default: + return "blockType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Block) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Block(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Block.property: object expected"); + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Block.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.paragraphs) { + if (!Array.isArray(object.paragraphs)) + throw TypeError(".google.cloud.vision.v1p2beta1.Block.paragraphs: array expected"); + message.paragraphs = []; + for (var i = 0; i < object.paragraphs.length; ++i) { + if (typeof object.paragraphs[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Block.paragraphs: object expected"); + message.paragraphs[i] = $root.google.cloud.vision.v1p2beta1.Paragraph.fromObject(object.paragraphs[i]); + } + } + switch (object.blockType) { + case "UNKNOWN": + case 0: + message.blockType = 0; + break; + case "TEXT": + case 1: + message.blockType = 1; + break; + case "TABLE": + case 2: + message.blockType = 2; + break; + case "PICTURE": + case 3: + message.blockType = 3; + break; + case "RULER": + case 4: + message.blockType = 4; + break; + case "BARCODE": + case 5: + message.blockType = 5; + break; + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Block + * @static + * @param {google.cloud.vision.v1p2beta1.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paragraphs = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.blockType = options.enums === String ? "UNKNOWN" : 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.paragraphs && message.paragraphs.length) { + object.paragraphs = []; + for (var j = 0; j < message.paragraphs.length; ++j) + object.paragraphs[j] = $root.google.cloud.vision.v1p2beta1.Paragraph.toObject(message.paragraphs[j], options); + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + object.blockType = options.enums === String ? $root.google.cloud.vision.v1p2beta1.Block.BlockType[message.blockType] : message.blockType; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BlockType enum. + * @name google.cloud.vision.v1p2beta1.Block.BlockType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} TEXT=1 TEXT value + * @property {number} TABLE=2 TABLE value + * @property {number} PICTURE=3 PICTURE value + * @property {number} RULER=4 RULER value + * @property {number} BARCODE=5 BARCODE value + */ + Block.BlockType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "TABLE"] = 2; + values[valuesById[3] = "PICTURE"] = 3; + values[valuesById[4] = "RULER"] = 4; + values[valuesById[5] = "BARCODE"] = 5; + return values; + })(); + + return Block; + })(); + + v1p2beta1.Paragraph = (function() { + + /** + * Properties of a Paragraph. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IParagraph + * @property {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null} [property] Paragraph property + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [boundingBox] Paragraph boundingBox + * @property {Array.|null} [words] Paragraph words + * @property {number|null} [confidence] Paragraph confidence + */ + + /** + * Constructs a new Paragraph. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Paragraph. + * @implements IParagraph + * @constructor + * @param {google.cloud.vision.v1p2beta1.IParagraph=} [properties] Properties to set + */ + function Paragraph(properties) { + this.words = []; + 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]]; + } + + /** + * Paragraph property. + * @member {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @instance + */ + Paragraph.prototype.property = null; + + /** + * Paragraph boundingBox. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @instance + */ + Paragraph.prototype.boundingBox = null; + + /** + * Paragraph words. + * @member {Array.} words + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @instance + */ + Paragraph.prototype.words = $util.emptyArray; + + /** + * Paragraph confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @instance + */ + Paragraph.prototype.confidence = 0; + + /** + * Creates a new Paragraph instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p2beta1.IParagraph=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Paragraph} Paragraph instance + */ + Paragraph.create = function create(properties) { + return new Paragraph(properties); + }; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Paragraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p2beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.vision.v1p2beta1.Word.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Paragraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p2beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.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.vision.v1p2beta1.Paragraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.vision.v1p2beta1.Word.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Paragraph message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Paragraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Word.verify(message.words[i]); + if (error) + return "words." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Paragraph} Paragraph + */ + Paragraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Paragraph) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Paragraph(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Paragraph.property: object expected"); + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Paragraph.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.vision.v1p2beta1.Paragraph.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Paragraph.words: object expected"); + message.words[i] = $root.google.cloud.vision.v1p2beta1.Word.fromObject(object.words[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p2beta1.Paragraph} message Paragraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Paragraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.vision.v1p2beta1.Word.toObject(message.words[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Paragraph to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Paragraph + * @instance + * @returns {Object.} JSON object + */ + Paragraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Paragraph; + })(); + + v1p2beta1.Word = (function() { + + /** + * Properties of a Word. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IWord + * @property {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null} [property] Word property + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [boundingBox] Word boundingBox + * @property {Array.|null} [symbols] Word symbols + * @property {number|null} [confidence] Word confidence + */ + + /** + * Constructs a new Word. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Word. + * @implements IWord + * @constructor + * @param {google.cloud.vision.v1p2beta1.IWord=} [properties] Properties to set + */ + function Word(properties) { + this.symbols = []; + 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]]; + } + + /** + * Word property. + * @member {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p2beta1.Word + * @instance + */ + Word.prototype.property = null; + + /** + * Word boundingBox. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p2beta1.Word + * @instance + */ + Word.prototype.boundingBox = null; + + /** + * Word symbols. + * @member {Array.} symbols + * @memberof google.cloud.vision.v1p2beta1.Word + * @instance + */ + Word.prototype.symbols = $util.emptyArray; + + /** + * Word confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.Word + * @instance + */ + Word.prototype.confidence = 0; + + /** + * Creates a new Word instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {google.cloud.vision.v1p2beta1.IWord=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Word} Word instance + */ + Word.create = function create(properties) { + return new Word(properties); + }; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Word.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {google.cloud.vision.v1p2beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.symbols != null && message.symbols.length) + for (var i = 0; i < message.symbols.length; ++i) + $root.google.cloud.vision.v1p2beta1.Symbol.encode(message.symbols[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Word.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {google.cloud.vision.v1p2beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Word message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.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.vision.v1p2beta1.Word(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.symbols && message.symbols.length)) + message.symbols = []; + message.symbols.push($root.google.cloud.vision.v1p2beta1.Symbol.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Word message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Word.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.symbols != null && message.hasOwnProperty("symbols")) { + if (!Array.isArray(message.symbols)) + return "symbols: array expected"; + for (var i = 0; i < message.symbols.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.Symbol.verify(message.symbols[i]); + if (error) + return "symbols." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Word} Word + */ + Word.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Word) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Word(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Word.property: object expected"); + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Word.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.symbols) { + if (!Array.isArray(object.symbols)) + throw TypeError(".google.cloud.vision.v1p2beta1.Word.symbols: array expected"); + message.symbols = []; + for (var i = 0; i < object.symbols.length; ++i) { + if (typeof object.symbols[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Word.symbols: object expected"); + message.symbols[i] = $root.google.cloud.vision.v1p2beta1.Symbol.fromObject(object.symbols[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Word + * @static + * @param {google.cloud.vision.v1p2beta1.Word} message Word + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Word.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.symbols = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.symbols && message.symbols.length) { + object.symbols = []; + for (var j = 0; j < message.symbols.length; ++j) + object.symbols[j] = $root.google.cloud.vision.v1p2beta1.Symbol.toObject(message.symbols[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Word to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Word + * @instance + * @returns {Object.} JSON object + */ + Word.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Word; + })(); + + v1p2beta1.Symbol = (function() { + + /** + * Properties of a Symbol. + * @memberof google.cloud.vision.v1p2beta1 + * @interface ISymbol + * @property {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null} [property] Symbol property + * @property {google.cloud.vision.v1p2beta1.IBoundingPoly|null} [boundingBox] Symbol boundingBox + * @property {string|null} [text] Symbol text + * @property {number|null} [confidence] Symbol confidence + */ + + /** + * Constructs a new Symbol. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a Symbol. + * @implements ISymbol + * @constructor + * @param {google.cloud.vision.v1p2beta1.ISymbol=} [properties] Properties to set + */ + function Symbol(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]]; + } + + /** + * Symbol property. + * @member {google.cloud.vision.v1p2beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @instance + */ + Symbol.prototype.property = null; + + /** + * Symbol boundingBox. + * @member {google.cloud.vision.v1p2beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @instance + */ + Symbol.prototype.boundingBox = null; + + /** + * Symbol text. + * @member {string} text + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @instance + */ + Symbol.prototype.text = ""; + + /** + * Symbol confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @instance + */ + Symbol.prototype.confidence = 0; + + /** + * Creates a new Symbol instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {google.cloud.vision.v1p2beta1.ISymbol=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.Symbol} Symbol instance + */ + Symbol.create = function create(properties) { + return new Symbol(properties); + }; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p2beta1.Symbol.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {google.cloud.vision.v1p2beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p2beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.Symbol.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {google.cloud.vision.v1p2beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.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.vision.v1p2beta1.Symbol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + message.text = reader.string(); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Symbol message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Symbol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p2beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.Symbol} Symbol + */ + Symbol.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.Symbol) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.Symbol(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Symbol.property: object expected"); + message.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.Symbol.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.text != null) + message.text = String(object.text); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @static + * @param {google.cloud.vision.v1p2beta1.Symbol} message Symbol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Symbol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.text = ""; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p2beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Symbol to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.Symbol + * @instance + * @returns {Object.} JSON object + */ + Symbol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Symbol; + })(); + + v1p2beta1.WebDetection = (function() { + + /** + * Properties of a WebDetection. + * @memberof google.cloud.vision.v1p2beta1 + * @interface IWebDetection + * @property {Array.|null} [webEntities] WebDetection webEntities + * @property {Array.|null} [fullMatchingImages] WebDetection fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebDetection partialMatchingImages + * @property {Array.|null} [pagesWithMatchingImages] WebDetection pagesWithMatchingImages + * @property {Array.|null} [visuallySimilarImages] WebDetection visuallySimilarImages + * @property {Array.|null} [bestGuessLabels] WebDetection bestGuessLabels + */ + + /** + * Constructs a new WebDetection. + * @memberof google.cloud.vision.v1p2beta1 + * @classdesc Represents a WebDetection. + * @implements IWebDetection + * @constructor + * @param {google.cloud.vision.v1p2beta1.IWebDetection=} [properties] Properties to set + */ + function WebDetection(properties) { + this.webEntities = []; + this.fullMatchingImages = []; + this.partialMatchingImages = []; + this.pagesWithMatchingImages = []; + this.visuallySimilarImages = []; + this.bestGuessLabels = []; + 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]]; + } + + /** + * WebDetection webEntities. + * @member {Array.} webEntities + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @instance + */ + WebDetection.prototype.webEntities = $util.emptyArray; + + /** + * WebDetection fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @instance + */ + WebDetection.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebDetection partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @instance + */ + WebDetection.prototype.partialMatchingImages = $util.emptyArray; + + /** + * WebDetection pagesWithMatchingImages. + * @member {Array.} pagesWithMatchingImages + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @instance + */ + WebDetection.prototype.pagesWithMatchingImages = $util.emptyArray; + + /** + * WebDetection visuallySimilarImages. + * @member {Array.} visuallySimilarImages + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @instance + */ + WebDetection.prototype.visuallySimilarImages = $util.emptyArray; + + /** + * WebDetection bestGuessLabels. + * @member {Array.} bestGuessLabels + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @instance + */ + WebDetection.prototype.bestGuessLabels = $util.emptyArray; + + /** + * Creates a new WebDetection instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p2beta1.IWebDetection=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.WebDetection} WebDetection instance + */ + WebDetection.create = function create(properties) { + return new WebDetection(properties); + }; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p2beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webEntities != null && message.webEntities.length) + for (var i = 0; i < message.webEntities.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebEntity.encode(message.webEntities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pagesWithMatchingImages != null && message.pagesWithMatchingImages.length) + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebPage.encode(message.pagesWithMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.visuallySimilarImages != null && message.visuallySimilarImages.length) + for (var i = 0; i < message.visuallySimilarImages.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.encode(message.visuallySimilarImages[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bestGuessLabels != null && message.bestGuessLabels.length) + for (var i = 0; i < message.bestGuessLabels.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebLabel.encode(message.bestGuessLabels[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p2beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.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.vision.v1p2beta1.WebDetection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.webEntities && message.webEntities.length)) + message.webEntities = []; + message.webEntities.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebEntity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.pagesWithMatchingImages && message.pagesWithMatchingImages.length)) + message.pagesWithMatchingImages = []; + message.pagesWithMatchingImages.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebPage.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.visuallySimilarImages && message.visuallySimilarImages.length)) + message.visuallySimilarImages = []; + message.visuallySimilarImages.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.bestGuessLabels && message.bestGuessLabels.length)) + message.bestGuessLabels = []; + message.bestGuessLabels.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebLabel.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetection message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webEntities != null && message.hasOwnProperty("webEntities")) { + if (!Array.isArray(message.webEntities)) + return "webEntities: array expected"; + for (var i = 0; i < message.webEntities.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebEntity.verify(message.webEntities[i]); + if (error) + return "webEntities." + error; + } + } + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + if (message.pagesWithMatchingImages != null && message.hasOwnProperty("pagesWithMatchingImages")) { + if (!Array.isArray(message.pagesWithMatchingImages)) + return "pagesWithMatchingImages: array expected"; + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebPage.verify(message.pagesWithMatchingImages[i]); + if (error) + return "pagesWithMatchingImages." + error; + } + } + if (message.visuallySimilarImages != null && message.hasOwnProperty("visuallySimilarImages")) { + if (!Array.isArray(message.visuallySimilarImages)) + return "visuallySimilarImages: array expected"; + for (var i = 0; i < message.visuallySimilarImages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify(message.visuallySimilarImages[i]); + if (error) + return "visuallySimilarImages." + error; + } + } + if (message.bestGuessLabels != null && message.hasOwnProperty("bestGuessLabels")) { + if (!Array.isArray(message.bestGuessLabels)) + return "bestGuessLabels: array expected"; + for (var i = 0; i < message.bestGuessLabels.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebLabel.verify(message.bestGuessLabels[i]); + if (error) + return "bestGuessLabels." + error; + } + } + return null; + }; + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.WebDetection} WebDetection + */ + WebDetection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.WebDetection) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.WebDetection(); + if (object.webEntities) { + if (!Array.isArray(object.webEntities)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.webEntities: array expected"); + message.webEntities = []; + for (var i = 0; i < object.webEntities.length; ++i) { + if (typeof object.webEntities[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.webEntities: object expected"); + message.webEntities[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebEntity.fromObject(object.webEntities[i]); + } + } + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + if (object.pagesWithMatchingImages) { + if (!Array.isArray(object.pagesWithMatchingImages)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.pagesWithMatchingImages: array expected"); + message.pagesWithMatchingImages = []; + for (var i = 0; i < object.pagesWithMatchingImages.length; ++i) { + if (typeof object.pagesWithMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.pagesWithMatchingImages: object expected"); + message.pagesWithMatchingImages[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebPage.fromObject(object.pagesWithMatchingImages[i]); + } + } + if (object.visuallySimilarImages) { + if (!Array.isArray(object.visuallySimilarImages)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.visuallySimilarImages: array expected"); + message.visuallySimilarImages = []; + for (var i = 0; i < object.visuallySimilarImages.length; ++i) { + if (typeof object.visuallySimilarImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.visuallySimilarImages: object expected"); + message.visuallySimilarImages[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.fromObject(object.visuallySimilarImages[i]); + } + } + if (object.bestGuessLabels) { + if (!Array.isArray(object.bestGuessLabels)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.bestGuessLabels: array expected"); + message.bestGuessLabels = []; + for (var i = 0; i < object.bestGuessLabels.length; ++i) { + if (typeof object.bestGuessLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.bestGuessLabels: object expected"); + message.bestGuessLabels[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebLabel.fromObject(object.bestGuessLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection} message WebDetection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.webEntities = []; + object.fullMatchingImages = []; + object.partialMatchingImages = []; + object.pagesWithMatchingImages = []; + object.visuallySimilarImages = []; + object.bestGuessLabels = []; + } + if (message.webEntities && message.webEntities.length) { + object.webEntities = []; + for (var j = 0; j < message.webEntities.length; ++j) + object.webEntities[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebEntity.toObject(message.webEntities[j], options); + } + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + if (message.pagesWithMatchingImages && message.pagesWithMatchingImages.length) { + object.pagesWithMatchingImages = []; + for (var j = 0; j < message.pagesWithMatchingImages.length; ++j) + object.pagesWithMatchingImages[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebPage.toObject(message.pagesWithMatchingImages[j], options); + } + if (message.visuallySimilarImages && message.visuallySimilarImages.length) { + object.visuallySimilarImages = []; + for (var j = 0; j < message.visuallySimilarImages.length; ++j) + object.visuallySimilarImages[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.toObject(message.visuallySimilarImages[j], options); + } + if (message.bestGuessLabels && message.bestGuessLabels.length) { + object.bestGuessLabels = []; + for (var j = 0; j < message.bestGuessLabels.length; ++j) + object.bestGuessLabels[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebLabel.toObject(message.bestGuessLabels[j], options); + } + return object; + }; + + /** + * Converts this WebDetection to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @instance + * @returns {Object.} JSON object + */ + WebDetection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WebDetection.WebEntity = (function() { + + /** + * Properties of a WebEntity. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @interface IWebEntity + * @property {string|null} [entityId] WebEntity entityId + * @property {number|null} [score] WebEntity score + * @property {string|null} [description] WebEntity description + */ + + /** + * Constructs a new WebEntity. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @classdesc Represents a WebEntity. + * @implements IWebEntity + * @constructor + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebEntity=} [properties] Properties to set + */ + function WebEntity(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]]; + } + + /** + * WebEntity entityId. + * @member {string} entityId + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.entityId = ""; + + /** + * WebEntity score. + * @member {number} score + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.score = 0; + + /** + * WebEntity description. + * @member {string} description + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.description = ""; + + /** + * Creates a new WebEntity instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebEntity=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebEntity} WebEntity instance + */ + WebEntity.create = function create(properties) { + return new WebEntity(properties); + }; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && message.hasOwnProperty("entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.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.vision.v1p2beta1.WebDetection.WebEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entityId = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebEntity message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebEntity} WebEntity + */ + WebEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.WebDetection.WebEntity) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.WebDetection.WebEntity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.score != null) + message.score = Number(object.score); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.WebEntity} message WebEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.score = 0; + object.description = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this WebEntity to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebEntity + * @instance + * @returns {Object.} JSON object + */ + WebEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebEntity; + })(); + + WebDetection.WebImage = (function() { + + /** + * Properties of a WebImage. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @interface IWebImage + * @property {string|null} [url] WebImage url + * @property {number|null} [score] WebImage score + */ + + /** + * Constructs a new WebImage. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @classdesc Represents a WebImage. + * @implements IWebImage + * @constructor + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebImage=} [properties] Properties to set + */ + function WebImage(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]]; + } + + /** + * WebImage url. + * @member {string} url + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.url = ""; + + /** + * WebImage score. + * @member {number} score + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.score = 0; + + /** + * Creates a new WebImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebImage} WebImage instance + */ + WebImage.create = function create(properties) { + return new WebImage(properties); + }; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.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.vision.v1p2beta1.WebDetection.WebImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebImage message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebImage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebImage} WebImage + */ + WebImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.WebImage} message WebImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.score = 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this WebImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebImage + * @instance + * @returns {Object.} JSON object + */ + WebImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebImage; + })(); + + WebDetection.WebPage = (function() { + + /** + * Properties of a WebPage. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @interface IWebPage + * @property {string|null} [url] WebPage url + * @property {number|null} [score] WebPage score + * @property {string|null} [pageTitle] WebPage pageTitle + * @property {Array.|null} [fullMatchingImages] WebPage fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebPage partialMatchingImages + */ + + /** + * Constructs a new WebPage. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @classdesc Represents a WebPage. + * @implements IWebPage + * @constructor + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebPage=} [properties] Properties to set + */ + function WebPage(properties) { + this.fullMatchingImages = []; + this.partialMatchingImages = []; + 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]]; + } + + /** + * WebPage url. + * @member {string} url + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.url = ""; + + /** + * WebPage score. + * @member {number} score + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.score = 0; + + /** + * WebPage pageTitle. + * @member {string} pageTitle + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.pageTitle = ""; + + /** + * WebPage fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebPage partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.partialMatchingImages = $util.emptyArray; + + /** + * Creates a new WebPage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebPage} WebPage instance + */ + WebPage.create = function create(properties) { + return new WebPage(properties); + }; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebPage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageTitle); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebPage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.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.vision.v1p2beta1.WebDetection.WebPage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pageTitle = reader.string(); + break; + case 4: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebPage message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebPage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + if (!$util.isString(message.pageTitle)) + return "pageTitle: string expected"; + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + return null; + }; + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebPage} WebPage + */ + WebPage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.WebDetection.WebPage) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.WebDetection.WebPage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + if (object.pageTitle != null) + message.pageTitle = String(object.pageTitle); + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.WebPage.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.WebPage.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.WebPage.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p2beta1.WebDetection.WebPage.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.WebPage} message WebPage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebPage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fullMatchingImages = []; + object.partialMatchingImages = []; + } + if (options.defaults) { + object.url = ""; + object.score = 0; + object.pageTitle = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + object.pageTitle = message.pageTitle; + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p2beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + return object; + }; + + /** + * Converts this WebPage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebPage + * @instance + * @returns {Object.} JSON object + */ + WebPage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebPage; + })(); + + WebDetection.WebLabel = (function() { + + /** + * Properties of a WebLabel. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @interface IWebLabel + * @property {string|null} [label] WebLabel label + * @property {string|null} [languageCode] WebLabel languageCode + */ + + /** + * Constructs a new WebLabel. + * @memberof google.cloud.vision.v1p2beta1.WebDetection + * @classdesc Represents a WebLabel. + * @implements IWebLabel + * @constructor + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebLabel=} [properties] Properties to set + */ + function WebLabel(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]]; + } + + /** + * WebLabel label. + * @member {string} label + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.label = ""; + + /** + * WebLabel languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.languageCode = ""; + + /** + * Creates a new WebLabel instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebLabel=} [properties] Properties to set + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebLabel} WebLabel instance + */ + WebLabel.create = function create(properties) { + return new WebLabel(properties); + }; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p2beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.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.vision.v1p2beta1.WebDetection.WebLabel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebLabel message. + * @function verify + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebLabel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p2beta1.WebDetection.WebLabel} WebLabel + */ + WebLabel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p2beta1.WebDetection.WebLabel) + return object; + var message = new $root.google.cloud.vision.v1p2beta1.WebDetection.WebLabel(); + if (object.label != null) + message.label = String(object.label); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p2beta1.WebDetection.WebLabel} message WebLabel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebLabel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.languageCode = ""; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this WebLabel to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p2beta1.WebDetection.WebLabel + * @instance + * @returns {Object.} JSON object + */ + WebLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebLabel; + })(); + + return WebDetection; + })(); + + return v1p2beta1; + })(); + + vision.v1p3beta1 = (function() { + + /** + * Namespace v1p3beta1. + * @memberof google.cloud.vision + * @namespace + */ + var v1p3beta1 = {}; + + v1p3beta1.ImageAnnotator = (function() { + + /** + * Constructs a new ImageAnnotator service. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImageAnnotator + * @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 ImageAnnotator(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ImageAnnotator.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageAnnotator; + + /** + * Creates new ImageAnnotator service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotator + * @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 {ImageAnnotator} RPC service. Useful where requests and/or responses are streamed. + */ + ImageAnnotator.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ImageAnnotator#batchAnnotateImages}. + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotator + * @typedef BatchAnnotateImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} [response] BatchAnnotateImagesResponse + */ + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ImageAnnotator.BatchAnnotateImagesCallback} callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.batchAnnotateImages = function batchAnnotateImages(request, callback) { + return this.rpcCall(batchAnnotateImages, $root.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest, $root.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse, request, callback); + }, "name", { value: "BatchAnnotateImages" }); + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotator + * @typedef AsyncBatchAnnotateFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ImageAnnotator.AsyncBatchAnnotateFilesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.asyncBatchAnnotateFiles = function asyncBatchAnnotateFiles(request, callback) { + return this.rpcCall(asyncBatchAnnotateFiles, $root.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AsyncBatchAnnotateFiles" }); + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ImageAnnotator; + })(); + + v1p3beta1.Feature = (function() { + + /** + * Properties of a Feature. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IFeature + * @property {google.cloud.vision.v1p3beta1.Feature.Type|null} [type] Feature type + * @property {number|null} [maxResults] Feature maxResults + * @property {string|null} [model] Feature model + */ + + /** + * Constructs a new Feature. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Feature. + * @implements IFeature + * @constructor + * @param {google.cloud.vision.v1p3beta1.IFeature=} [properties] Properties to set + */ + function Feature(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]]; + } + + /** + * Feature type. + * @member {google.cloud.vision.v1p3beta1.Feature.Type} type + * @memberof google.cloud.vision.v1p3beta1.Feature + * @instance + */ + Feature.prototype.type = 0; + + /** + * Feature maxResults. + * @member {number} maxResults + * @memberof google.cloud.vision.v1p3beta1.Feature + * @instance + */ + Feature.prototype.maxResults = 0; + + /** + * Feature model. + * @member {string} model + * @memberof google.cloud.vision.v1p3beta1.Feature + * @instance + */ + Feature.prototype.model = ""; + + /** + * Creates a new Feature instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {google.cloud.vision.v1p3beta1.IFeature=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Feature} Feature instance + */ + Feature.create = function create(properties) { + return new Feature(properties); + }; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Feature.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {google.cloud.vision.v1p3beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxResults); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Feature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {google.cloud.vision.v1p3beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.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.vision.v1p3beta1.Feature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.maxResults = reader.int32(); + break; + case 3: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feature message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 11: + case 6: + case 7: + case 9: + case 10: + case 12: + case 19: + break; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Feature} Feature + */ + Feature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Feature) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Feature(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "FACE_DETECTION": + case 1: + message.type = 1; + break; + case "LANDMARK_DETECTION": + case 2: + message.type = 2; + break; + case "LOGO_DETECTION": + case 3: + message.type = 3; + break; + case "LABEL_DETECTION": + case 4: + message.type = 4; + break; + case "TEXT_DETECTION": + case 5: + message.type = 5; + break; + case "DOCUMENT_TEXT_DETECTION": + case 11: + message.type = 11; + break; + case "SAFE_SEARCH_DETECTION": + case 6: + message.type = 6; + break; + case "IMAGE_PROPERTIES": + case 7: + message.type = 7; + break; + case "CROP_HINTS": + case 9: + message.type = 9; + break; + case "WEB_DETECTION": + case 10: + message.type = 10; + break; + case "PRODUCT_SEARCH": + case 12: + message.type = 12; + break; + case "OBJECT_LOCALIZATION": + case 19: + message.type = 19; + break; + } + if (object.maxResults != null) + message.maxResults = object.maxResults | 0; + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Feature + * @static + * @param {google.cloud.vision.v1p3beta1.Feature} message Feature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.maxResults = 0; + object.model = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Feature.Type[message.type] : message.type; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + object.maxResults = message.maxResults; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this Feature to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Feature + * @instance + * @returns {Object.} JSON object + */ + Feature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p3beta1.Feature.Type + * @enum {string} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} FACE_DETECTION=1 FACE_DETECTION value + * @property {number} LANDMARK_DETECTION=2 LANDMARK_DETECTION value + * @property {number} LOGO_DETECTION=3 LOGO_DETECTION value + * @property {number} LABEL_DETECTION=4 LABEL_DETECTION value + * @property {number} TEXT_DETECTION=5 TEXT_DETECTION value + * @property {number} DOCUMENT_TEXT_DETECTION=11 DOCUMENT_TEXT_DETECTION value + * @property {number} SAFE_SEARCH_DETECTION=6 SAFE_SEARCH_DETECTION value + * @property {number} IMAGE_PROPERTIES=7 IMAGE_PROPERTIES value + * @property {number} CROP_HINTS=9 CROP_HINTS value + * @property {number} WEB_DETECTION=10 WEB_DETECTION value + * @property {number} PRODUCT_SEARCH=12 PRODUCT_SEARCH value + * @property {number} OBJECT_LOCALIZATION=19 OBJECT_LOCALIZATION value + */ + Feature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACE_DETECTION"] = 1; + values[valuesById[2] = "LANDMARK_DETECTION"] = 2; + values[valuesById[3] = "LOGO_DETECTION"] = 3; + values[valuesById[4] = "LABEL_DETECTION"] = 4; + values[valuesById[5] = "TEXT_DETECTION"] = 5; + values[valuesById[11] = "DOCUMENT_TEXT_DETECTION"] = 11; + values[valuesById[6] = "SAFE_SEARCH_DETECTION"] = 6; + values[valuesById[7] = "IMAGE_PROPERTIES"] = 7; + values[valuesById[9] = "CROP_HINTS"] = 9; + values[valuesById[10] = "WEB_DETECTION"] = 10; + values[valuesById[12] = "PRODUCT_SEARCH"] = 12; + values[valuesById[19] = "OBJECT_LOCALIZATION"] = 19; + return values; + })(); + + return Feature; + })(); + + v1p3beta1.ImageSource = (function() { + + /** + * Properties of an ImageSource. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImageSource + * @property {string|null} [gcsImageUri] ImageSource gcsImageUri + * @property {string|null} [imageUri] ImageSource imageUri + */ + + /** + * Constructs a new ImageSource. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImageSource. + * @implements IImageSource + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImageSource=} [properties] Properties to set + */ + function ImageSource(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]]; + } + + /** + * ImageSource gcsImageUri. + * @member {string} gcsImageUri + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @instance + */ + ImageSource.prototype.gcsImageUri = ""; + + /** + * ImageSource imageUri. + * @member {string} imageUri + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @instance + */ + ImageSource.prototype.imageUri = ""; + + /** + * Creates a new ImageSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p3beta1.IImageSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImageSource} ImageSource instance + */ + ImageSource.create = function create(properties) { + return new ImageSource(properties); + }; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p3beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsImageUri); + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageUri); + return writer; + }; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p3beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.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.vision.v1p3beta1.ImageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsImageUri = reader.string(); + break; + case 2: + message.imageUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSource message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + if (!$util.isString(message.gcsImageUri)) + return "gcsImageUri: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + return null; + }; + + /** + * Creates an ImageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImageSource} ImageSource + */ + ImageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImageSource) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImageSource(); + if (object.gcsImageUri != null) + message.gcsImageUri = String(object.gcsImageUri); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + return message; + }; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p3beta1.ImageSource} message ImageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsImageUri = ""; + object.imageUri = ""; + } + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + object.gcsImageUri = message.gcsImageUri; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + return object; + }; + + /** + * Converts this ImageSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImageSource + * @instance + * @returns {Object.} JSON object + */ + ImageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageSource; + })(); + + v1p3beta1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImage + * @property {Uint8Array|null} [content] Image content + * @property {google.cloud.vision.v1p3beta1.IImageSource|null} [source] Image source + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.vision.v1p3beta1.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 content. + * @member {Uint8Array} content + * @memberof google.cloud.vision.v1p3beta1.Image + * @instance + */ + Image.prototype.content = $util.newBuffer([]); + + /** + * Image source. + * @member {google.cloud.vision.v1p3beta1.IImageSource|null|undefined} source + * @memberof google.cloud.vision.v1p3beta1.Image + * @instance + */ + Image.prototype.source = null; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Image + * @static + * @param {google.cloud.vision.v1p3beta1.IImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Image + * @static + * @param {google.cloud.vision.v1p3beta1.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.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.vision.v1p3beta1.ImageSource.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Image + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.bytes(); + break; + case 2: + message.source = $root.google.cloud.vision.v1p3beta1.ImageSource.decode(reader, reader.uint32()); + 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.vision.v1p3beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.vision.v1p3beta1.ImageSource.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Image) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Image(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Image.source: object expected"); + message.source = $root.google.cloud.vision.v1p3beta1.ImageSource.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Image + * @static + * @param {google.cloud.vision.v1p3beta1.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) { + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + object.source = null; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.vision.v1p3beta1.ImageSource.toObject(message.source, options); + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Image; + })(); + + v1p3beta1.FaceAnnotation = (function() { + + /** + * Properties of a FaceAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IFaceAnnotation + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingPoly] FaceAnnotation boundingPoly + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [fdBoundingPoly] FaceAnnotation fdBoundingPoly + * @property {Array.|null} [landmarks] FaceAnnotation landmarks + * @property {number|null} [rollAngle] FaceAnnotation rollAngle + * @property {number|null} [panAngle] FaceAnnotation panAngle + * @property {number|null} [tiltAngle] FaceAnnotation tiltAngle + * @property {number|null} [detectionConfidence] FaceAnnotation detectionConfidence + * @property {number|null} [landmarkingConfidence] FaceAnnotation landmarkingConfidence + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [joyLikelihood] FaceAnnotation joyLikelihood + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [sorrowLikelihood] FaceAnnotation sorrowLikelihood + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [angerLikelihood] FaceAnnotation angerLikelihood + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [surpriseLikelihood] FaceAnnotation surpriseLikelihood + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [underExposedLikelihood] FaceAnnotation underExposedLikelihood + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [blurredLikelihood] FaceAnnotation blurredLikelihood + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [headwearLikelihood] FaceAnnotation headwearLikelihood + */ + + /** + * Constructs a new FaceAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a FaceAnnotation. + * @implements IFaceAnnotation + * @constructor + * @param {google.cloud.vision.v1p3beta1.IFaceAnnotation=} [properties] Properties to set + */ + function FaceAnnotation(properties) { + this.landmarks = []; + 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]]; + } + + /** + * FaceAnnotation boundingPoly. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.boundingPoly = null; + + /** + * FaceAnnotation fdBoundingPoly. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} fdBoundingPoly + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.fdBoundingPoly = null; + + /** + * FaceAnnotation landmarks. + * @member {Array.} landmarks + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarks = $util.emptyArray; + + /** + * FaceAnnotation rollAngle. + * @member {number} rollAngle + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.rollAngle = 0; + + /** + * FaceAnnotation panAngle. + * @member {number} panAngle + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.panAngle = 0; + + /** + * FaceAnnotation tiltAngle. + * @member {number} tiltAngle + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.tiltAngle = 0; + + /** + * FaceAnnotation detectionConfidence. + * @member {number} detectionConfidence + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.detectionConfidence = 0; + + /** + * FaceAnnotation landmarkingConfidence. + * @member {number} landmarkingConfidence + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarkingConfidence = 0; + + /** + * FaceAnnotation joyLikelihood. + * @member {google.cloud.vision.v1p3beta1.Likelihood} joyLikelihood + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.joyLikelihood = 0; + + /** + * FaceAnnotation sorrowLikelihood. + * @member {google.cloud.vision.v1p3beta1.Likelihood} sorrowLikelihood + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.sorrowLikelihood = 0; + + /** + * FaceAnnotation angerLikelihood. + * @member {google.cloud.vision.v1p3beta1.Likelihood} angerLikelihood + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.angerLikelihood = 0; + + /** + * FaceAnnotation surpriseLikelihood. + * @member {google.cloud.vision.v1p3beta1.Likelihood} surpriseLikelihood + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.surpriseLikelihood = 0; + + /** + * FaceAnnotation underExposedLikelihood. + * @member {google.cloud.vision.v1p3beta1.Likelihood} underExposedLikelihood + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.underExposedLikelihood = 0; + + /** + * FaceAnnotation blurredLikelihood. + * @member {google.cloud.vision.v1p3beta1.Likelihood} blurredLikelihood + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.blurredLikelihood = 0; + + /** + * FaceAnnotation headwearLikelihood. + * @member {google.cloud.vision.v1p3beta1.Likelihood} headwearLikelihood + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.headwearLikelihood = 0; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IFaceAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation} FaceAnnotation instance + */ + FaceAnnotation.create = function create(properties) { + return new FaceAnnotation(properties); + }; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.fdBoundingPoly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.landmarks != null && message.landmarks.length) + for (var i = 0; i < message.landmarks.length; ++i) + $root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.encode(message.landmarks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.rollAngle); + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.panAngle); + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.tiltAngle); + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.detectionConfidence); + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.landmarkingConfidence); + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.joyLikelihood); + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sorrowLikelihood); + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.angerLikelihood); + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.surpriseLikelihood); + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.underExposedLikelihood); + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.blurredLikelihood); + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.headwearLikelihood); + return writer; + }; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.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.vision.v1p3beta1.FaceAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.fdBoundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.landmarks && message.landmarks.length)) + message.landmarks = []; + message.landmarks.push($root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.decode(reader, reader.uint32())); + break; + case 4: + message.rollAngle = reader.float(); + break; + case 5: + message.panAngle = reader.float(); + break; + case 6: + message.tiltAngle = reader.float(); + break; + case 7: + message.detectionConfidence = reader.float(); + break; + case 8: + message.landmarkingConfidence = reader.float(); + break; + case 9: + message.joyLikelihood = reader.int32(); + break; + case 10: + message.sorrowLikelihood = reader.int32(); + break; + case 11: + message.angerLikelihood = reader.int32(); + break; + case 12: + message.surpriseLikelihood = reader.int32(); + break; + case 13: + message.underExposedLikelihood = reader.int32(); + break; + case 14: + message.blurredLikelihood = reader.int32(); + break; + case 15: + message.headwearLikelihood = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.fdBoundingPoly); + if (error) + return "fdBoundingPoly." + error; + } + if (message.landmarks != null && message.hasOwnProperty("landmarks")) { + if (!Array.isArray(message.landmarks)) + return "landmarks: array expected"; + for (var i = 0; i < message.landmarks.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.verify(message.landmarks[i]); + if (error) + return "landmarks." + error; + } + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + if (typeof message.rollAngle !== "number") + return "rollAngle: number expected"; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + if (typeof message.panAngle !== "number") + return "panAngle: number expected"; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + if (typeof message.tiltAngle !== "number") + return "tiltAngle: number expected"; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + if (typeof message.detectionConfidence !== "number") + return "detectionConfidence: number expected"; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + if (typeof message.landmarkingConfidence !== "number") + return "landmarkingConfidence: number expected"; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + switch (message.joyLikelihood) { + default: + return "joyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + switch (message.sorrowLikelihood) { + default: + return "sorrowLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + switch (message.angerLikelihood) { + default: + return "angerLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + switch (message.surpriseLikelihood) { + default: + return "surpriseLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + switch (message.underExposedLikelihood) { + default: + return "underExposedLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + switch (message.blurredLikelihood) { + default: + return "blurredLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + switch (message.headwearLikelihood) { + default: + return "headwearLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation} FaceAnnotation + */ + FaceAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.FaceAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.FaceAnnotation(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.FaceAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.fdBoundingPoly != null) { + if (typeof object.fdBoundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.FaceAnnotation.fdBoundingPoly: object expected"); + message.fdBoundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.fdBoundingPoly); + } + if (object.landmarks) { + if (!Array.isArray(object.landmarks)) + throw TypeError(".google.cloud.vision.v1p3beta1.FaceAnnotation.landmarks: array expected"); + message.landmarks = []; + for (var i = 0; i < object.landmarks.length; ++i) { + if (typeof object.landmarks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.FaceAnnotation.landmarks: object expected"); + message.landmarks[i] = $root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.fromObject(object.landmarks[i]); + } + } + if (object.rollAngle != null) + message.rollAngle = Number(object.rollAngle); + if (object.panAngle != null) + message.panAngle = Number(object.panAngle); + if (object.tiltAngle != null) + message.tiltAngle = Number(object.tiltAngle); + if (object.detectionConfidence != null) + message.detectionConfidence = Number(object.detectionConfidence); + if (object.landmarkingConfidence != null) + message.landmarkingConfidence = Number(object.landmarkingConfidence); + switch (object.joyLikelihood) { + case "UNKNOWN": + case 0: + message.joyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.joyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.joyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.joyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.joyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.joyLikelihood = 5; + break; + } + switch (object.sorrowLikelihood) { + case "UNKNOWN": + case 0: + message.sorrowLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.sorrowLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.sorrowLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.sorrowLikelihood = 3; + break; + case "LIKELY": + case 4: + message.sorrowLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.sorrowLikelihood = 5; + break; + } + switch (object.angerLikelihood) { + case "UNKNOWN": + case 0: + message.angerLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.angerLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.angerLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.angerLikelihood = 3; + break; + case "LIKELY": + case 4: + message.angerLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.angerLikelihood = 5; + break; + } + switch (object.surpriseLikelihood) { + case "UNKNOWN": + case 0: + message.surpriseLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.surpriseLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.surpriseLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.surpriseLikelihood = 3; + break; + case "LIKELY": + case 4: + message.surpriseLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.surpriseLikelihood = 5; + break; + } + switch (object.underExposedLikelihood) { + case "UNKNOWN": + case 0: + message.underExposedLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.underExposedLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.underExposedLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.underExposedLikelihood = 3; + break; + case "LIKELY": + case 4: + message.underExposedLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.underExposedLikelihood = 5; + break; + } + switch (object.blurredLikelihood) { + case "UNKNOWN": + case 0: + message.blurredLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.blurredLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.blurredLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.blurredLikelihood = 3; + break; + case "LIKELY": + case 4: + message.blurredLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.blurredLikelihood = 5; + break; + } + switch (object.headwearLikelihood) { + case "UNKNOWN": + case 0: + message.headwearLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.headwearLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.headwearLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.headwearLikelihood = 3; + break; + case "LIKELY": + case 4: + message.headwearLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.headwearLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.FaceAnnotation} message FaceAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.landmarks = []; + if (options.defaults) { + object.boundingPoly = null; + object.fdBoundingPoly = null; + object.rollAngle = 0; + object.panAngle = 0; + object.tiltAngle = 0; + object.detectionConfidence = 0; + object.landmarkingConfidence = 0; + object.joyLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.sorrowLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.angerLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.surpriseLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.underExposedLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.blurredLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.headwearLikelihood = options.enums === String ? "UNKNOWN" : 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + object.fdBoundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.fdBoundingPoly, options); + if (message.landmarks && message.landmarks.length) { + object.landmarks = []; + for (var j = 0; j < message.landmarks.length; ++j) + object.landmarks[j] = $root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.toObject(message.landmarks[j], options); + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + object.rollAngle = options.json && !isFinite(message.rollAngle) ? String(message.rollAngle) : message.rollAngle; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + object.panAngle = options.json && !isFinite(message.panAngle) ? String(message.panAngle) : message.panAngle; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + object.tiltAngle = options.json && !isFinite(message.tiltAngle) ? String(message.tiltAngle) : message.tiltAngle; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + object.detectionConfidence = options.json && !isFinite(message.detectionConfidence) ? String(message.detectionConfidence) : message.detectionConfidence; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + object.landmarkingConfidence = options.json && !isFinite(message.landmarkingConfidence) ? String(message.landmarkingConfidence) : message.landmarkingConfidence; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + object.joyLikelihood = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.joyLikelihood] : message.joyLikelihood; + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + object.sorrowLikelihood = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.sorrowLikelihood] : message.sorrowLikelihood; + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + object.angerLikelihood = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.angerLikelihood] : message.angerLikelihood; + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + object.surpriseLikelihood = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.surpriseLikelihood] : message.surpriseLikelihood; + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + object.underExposedLikelihood = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.underExposedLikelihood] : message.underExposedLikelihood; + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + object.blurredLikelihood = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.blurredLikelihood] : message.blurredLikelihood; + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + object.headwearLikelihood = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.headwearLikelihood] : message.headwearLikelihood; + return object; + }; + + /** + * Converts this FaceAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FaceAnnotation.Landmark = (function() { + + /** + * Properties of a Landmark. + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @interface ILandmark + * @property {google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type|null} [type] Landmark type + * @property {google.cloud.vision.v1p3beta1.IPosition|null} [position] Landmark position + */ + + /** + * Constructs a new Landmark. + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation + * @classdesc Represents a Landmark. + * @implements ILandmark + * @constructor + * @param {google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + */ + function Landmark(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]]; + } + + /** + * Landmark type. + * @member {google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type} type + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.type = 0; + + /** + * Landmark position. + * @member {google.cloud.vision.v1p3beta1.IPosition|null|undefined} position + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.position = null; + + /** + * Creates a new Landmark instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark} Landmark instance + */ + Landmark.create = function create(properties) { + return new Landmark(properties); + }; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.position != null && message.hasOwnProperty("position")) + $root.google.cloud.vision.v1p3beta1.Position.encode(message.position, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p3beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.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.vision.v1p3beta1.FaceAnnotation.Landmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.type = reader.int32(); + break; + case 4: + message.position = $root.google.cloud.vision.v1p3beta1.Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Landmark message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Landmark.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + break; + } + if (message.position != null && message.hasOwnProperty("position")) { + var error = $root.google.cloud.vision.v1p3beta1.Position.verify(message.position); + if (error) + return "position." + error; + } + return null; + }; + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark} Landmark + */ + Landmark.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark(); + switch (object.type) { + case "UNKNOWN_LANDMARK": + case 0: + message.type = 0; + break; + case "LEFT_EYE": + case 1: + message.type = 1; + break; + case "RIGHT_EYE": + case 2: + message.type = 2; + break; + case "LEFT_OF_LEFT_EYEBROW": + case 3: + message.type = 3; + break; + case "RIGHT_OF_LEFT_EYEBROW": + case 4: + message.type = 4; + break; + case "LEFT_OF_RIGHT_EYEBROW": + case 5: + message.type = 5; + break; + case "RIGHT_OF_RIGHT_EYEBROW": + case 6: + message.type = 6; + break; + case "MIDPOINT_BETWEEN_EYES": + case 7: + message.type = 7; + break; + case "NOSE_TIP": + case 8: + message.type = 8; + break; + case "UPPER_LIP": + case 9: + message.type = 9; + break; + case "LOWER_LIP": + case 10: + message.type = 10; + break; + case "MOUTH_LEFT": + case 11: + message.type = 11; + break; + case "MOUTH_RIGHT": + case 12: + message.type = 12; + break; + case "MOUTH_CENTER": + case 13: + message.type = 13; + break; + case "NOSE_BOTTOM_RIGHT": + case 14: + message.type = 14; + break; + case "NOSE_BOTTOM_LEFT": + case 15: + message.type = 15; + break; + case "NOSE_BOTTOM_CENTER": + case 16: + message.type = 16; + break; + case "LEFT_EYE_TOP_BOUNDARY": + case 17: + message.type = 17; + break; + case "LEFT_EYE_RIGHT_CORNER": + case 18: + message.type = 18; + break; + case "LEFT_EYE_BOTTOM_BOUNDARY": + case 19: + message.type = 19; + break; + case "LEFT_EYE_LEFT_CORNER": + case 20: + message.type = 20; + break; + case "RIGHT_EYE_TOP_BOUNDARY": + case 21: + message.type = 21; + break; + case "RIGHT_EYE_RIGHT_CORNER": + case 22: + message.type = 22; + break; + case "RIGHT_EYE_BOTTOM_BOUNDARY": + case 23: + message.type = 23; + break; + case "RIGHT_EYE_LEFT_CORNER": + case 24: + message.type = 24; + break; + case "LEFT_EYEBROW_UPPER_MIDPOINT": + case 25: + message.type = 25; + break; + case "RIGHT_EYEBROW_UPPER_MIDPOINT": + case 26: + message.type = 26; + break; + case "LEFT_EAR_TRAGION": + case 27: + message.type = 27; + break; + case "RIGHT_EAR_TRAGION": + case 28: + message.type = 28; + break; + case "LEFT_EYE_PUPIL": + case 29: + message.type = 29; + break; + case "RIGHT_EYE_PUPIL": + case 30: + message.type = 30; + break; + case "FOREHEAD_GLABELLA": + case 31: + message.type = 31; + break; + case "CHIN_GNATHION": + case 32: + message.type = 32; + break; + case "CHIN_LEFT_GONION": + case 33: + message.type = 33; + break; + case "CHIN_RIGHT_GONION": + case 34: + message.type = 34; + break; + } + if (object.position != null) { + if (typeof object.position !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.position: object expected"); + message.position = $root.google.cloud.vision.v1p3beta1.Position.fromObject(object.position); + } + return message; + }; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark} message Landmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Landmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN_LANDMARK" : 0; + object.position = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type[message.type] : message.type; + if (message.position != null && message.hasOwnProperty("position")) + object.position = $root.google.cloud.vision.v1p3beta1.Position.toObject(message.position, options); + return object; + }; + + /** + * Converts this Landmark to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark + * @instance + * @returns {Object.} JSON object + */ + Landmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type + * @enum {string} + * @property {number} UNKNOWN_LANDMARK=0 UNKNOWN_LANDMARK value + * @property {number} LEFT_EYE=1 LEFT_EYE value + * @property {number} RIGHT_EYE=2 RIGHT_EYE value + * @property {number} LEFT_OF_LEFT_EYEBROW=3 LEFT_OF_LEFT_EYEBROW value + * @property {number} RIGHT_OF_LEFT_EYEBROW=4 RIGHT_OF_LEFT_EYEBROW value + * @property {number} LEFT_OF_RIGHT_EYEBROW=5 LEFT_OF_RIGHT_EYEBROW value + * @property {number} RIGHT_OF_RIGHT_EYEBROW=6 RIGHT_OF_RIGHT_EYEBROW value + * @property {number} MIDPOINT_BETWEEN_EYES=7 MIDPOINT_BETWEEN_EYES value + * @property {number} NOSE_TIP=8 NOSE_TIP value + * @property {number} UPPER_LIP=9 UPPER_LIP value + * @property {number} LOWER_LIP=10 LOWER_LIP value + * @property {number} MOUTH_LEFT=11 MOUTH_LEFT value + * @property {number} MOUTH_RIGHT=12 MOUTH_RIGHT value + * @property {number} MOUTH_CENTER=13 MOUTH_CENTER value + * @property {number} NOSE_BOTTOM_RIGHT=14 NOSE_BOTTOM_RIGHT value + * @property {number} NOSE_BOTTOM_LEFT=15 NOSE_BOTTOM_LEFT value + * @property {number} NOSE_BOTTOM_CENTER=16 NOSE_BOTTOM_CENTER value + * @property {number} LEFT_EYE_TOP_BOUNDARY=17 LEFT_EYE_TOP_BOUNDARY value + * @property {number} LEFT_EYE_RIGHT_CORNER=18 LEFT_EYE_RIGHT_CORNER value + * @property {number} LEFT_EYE_BOTTOM_BOUNDARY=19 LEFT_EYE_BOTTOM_BOUNDARY value + * @property {number} LEFT_EYE_LEFT_CORNER=20 LEFT_EYE_LEFT_CORNER value + * @property {number} RIGHT_EYE_TOP_BOUNDARY=21 RIGHT_EYE_TOP_BOUNDARY value + * @property {number} RIGHT_EYE_RIGHT_CORNER=22 RIGHT_EYE_RIGHT_CORNER value + * @property {number} RIGHT_EYE_BOTTOM_BOUNDARY=23 RIGHT_EYE_BOTTOM_BOUNDARY value + * @property {number} RIGHT_EYE_LEFT_CORNER=24 RIGHT_EYE_LEFT_CORNER value + * @property {number} LEFT_EYEBROW_UPPER_MIDPOINT=25 LEFT_EYEBROW_UPPER_MIDPOINT value + * @property {number} RIGHT_EYEBROW_UPPER_MIDPOINT=26 RIGHT_EYEBROW_UPPER_MIDPOINT value + * @property {number} LEFT_EAR_TRAGION=27 LEFT_EAR_TRAGION value + * @property {number} RIGHT_EAR_TRAGION=28 RIGHT_EAR_TRAGION value + * @property {number} LEFT_EYE_PUPIL=29 LEFT_EYE_PUPIL value + * @property {number} RIGHT_EYE_PUPIL=30 RIGHT_EYE_PUPIL value + * @property {number} FOREHEAD_GLABELLA=31 FOREHEAD_GLABELLA value + * @property {number} CHIN_GNATHION=32 CHIN_GNATHION value + * @property {number} CHIN_LEFT_GONION=33 CHIN_LEFT_GONION value + * @property {number} CHIN_RIGHT_GONION=34 CHIN_RIGHT_GONION value + */ + Landmark.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_LANDMARK"] = 0; + values[valuesById[1] = "LEFT_EYE"] = 1; + values[valuesById[2] = "RIGHT_EYE"] = 2; + values[valuesById[3] = "LEFT_OF_LEFT_EYEBROW"] = 3; + values[valuesById[4] = "RIGHT_OF_LEFT_EYEBROW"] = 4; + values[valuesById[5] = "LEFT_OF_RIGHT_EYEBROW"] = 5; + values[valuesById[6] = "RIGHT_OF_RIGHT_EYEBROW"] = 6; + values[valuesById[7] = "MIDPOINT_BETWEEN_EYES"] = 7; + values[valuesById[8] = "NOSE_TIP"] = 8; + values[valuesById[9] = "UPPER_LIP"] = 9; + values[valuesById[10] = "LOWER_LIP"] = 10; + values[valuesById[11] = "MOUTH_LEFT"] = 11; + values[valuesById[12] = "MOUTH_RIGHT"] = 12; + values[valuesById[13] = "MOUTH_CENTER"] = 13; + values[valuesById[14] = "NOSE_BOTTOM_RIGHT"] = 14; + values[valuesById[15] = "NOSE_BOTTOM_LEFT"] = 15; + values[valuesById[16] = "NOSE_BOTTOM_CENTER"] = 16; + values[valuesById[17] = "LEFT_EYE_TOP_BOUNDARY"] = 17; + values[valuesById[18] = "LEFT_EYE_RIGHT_CORNER"] = 18; + values[valuesById[19] = "LEFT_EYE_BOTTOM_BOUNDARY"] = 19; + values[valuesById[20] = "LEFT_EYE_LEFT_CORNER"] = 20; + values[valuesById[21] = "RIGHT_EYE_TOP_BOUNDARY"] = 21; + values[valuesById[22] = "RIGHT_EYE_RIGHT_CORNER"] = 22; + values[valuesById[23] = "RIGHT_EYE_BOTTOM_BOUNDARY"] = 23; + values[valuesById[24] = "RIGHT_EYE_LEFT_CORNER"] = 24; + values[valuesById[25] = "LEFT_EYEBROW_UPPER_MIDPOINT"] = 25; + values[valuesById[26] = "RIGHT_EYEBROW_UPPER_MIDPOINT"] = 26; + values[valuesById[27] = "LEFT_EAR_TRAGION"] = 27; + values[valuesById[28] = "RIGHT_EAR_TRAGION"] = 28; + values[valuesById[29] = "LEFT_EYE_PUPIL"] = 29; + values[valuesById[30] = "RIGHT_EYE_PUPIL"] = 30; + values[valuesById[31] = "FOREHEAD_GLABELLA"] = 31; + values[valuesById[32] = "CHIN_GNATHION"] = 32; + values[valuesById[33] = "CHIN_LEFT_GONION"] = 33; + values[valuesById[34] = "CHIN_RIGHT_GONION"] = 34; + return values; + })(); + + return Landmark; + })(); + + return FaceAnnotation; + })(); + + v1p3beta1.LocationInfo = (function() { + + /** + * Properties of a LocationInfo. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ILocationInfo + * @property {google.type.ILatLng|null} [latLng] LocationInfo latLng + */ + + /** + * Constructs a new LocationInfo. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo + * @constructor + * @param {google.cloud.vision.v1p3beta1.ILocationInfo=} [properties] Properties to set + */ + function LocationInfo(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]]; + } + + /** + * LocationInfo latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @instance + */ + LocationInfo.prototype.latLng = null; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.LocationInfo} LocationInfo instance + */ + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); + }; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && message.hasOwnProperty("latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.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.vision.v1p3beta1.LocationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationInfo message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + return null; + }; + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.LocationInfo} LocationInfo + */ + LocationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.LocationInfo) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.LocationInfo(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.LocationInfo.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + return message; + }; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p3beta1.LocationInfo} message LocationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.latLng = null; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + return object; + }; + + /** + * Converts this LocationInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.LocationInfo + * @instance + * @returns {Object.} JSON object + */ + LocationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationInfo; + })(); + + v1p3beta1.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [value] Property value + * @property {number|Long|null} [uint64Value] Property uint64Value + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.vision.v1p3beta1.IProperty=} [properties] Properties to set + */ + function Property(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]]; + } + + /** + * Property name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property value. + * @member {string} value + * @memberof google.cloud.vision.v1p3beta1.Property + * @instance + */ + Property.prototype.value = ""; + + /** + * Property uint64Value. + * @member {number|Long} uint64Value + * @memberof google.cloud.vision.v1p3beta1.Property + * @instance + */ + Property.prototype.uint64Value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {google.cloud.vision.v1p3beta1.IProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {google.cloud.vision.v1p3beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.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.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.uint64Value); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {google.cloud.vision.v1p3beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Property message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.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.vision.v1p3beta1.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.uint64Value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Property message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Property.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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (!$util.isInteger(message.uint64Value) && !(message.uint64Value && $util.isInteger(message.uint64Value.low) && $util.isInteger(message.uint64Value.high))) + return "uint64Value: integer|Long expected"; + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Property) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.uint64Value != null) + if ($util.Long) + (message.uint64Value = $util.Long.fromValue(object.uint64Value)).unsigned = true; + else if (typeof object.uint64Value === "string") + message.uint64Value = parseInt(object.uint64Value, 10); + else if (typeof object.uint64Value === "number") + message.uint64Value = object.uint64Value; + else if (typeof object.uint64Value === "object") + message.uint64Value = new $util.LongBits(object.uint64Value.low >>> 0, object.uint64Value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Property + * @static + * @param {google.cloud.vision.v1p3beta1.Property} message Property + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Property.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.uint64Value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.uint64Value = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (typeof message.uint64Value === "number") + object.uint64Value = options.longs === String ? String(message.uint64Value) : message.uint64Value; + else + object.uint64Value = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Value) : options.longs === Number ? new $util.LongBits(message.uint64Value.low >>> 0, message.uint64Value.high >>> 0).toNumber(true) : message.uint64Value; + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Property + * @instance + * @returns {Object.} JSON object + */ + Property.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Property; + })(); + + v1p3beta1.EntityAnnotation = (function() { + + /** + * Properties of an EntityAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IEntityAnnotation + * @property {string|null} [mid] EntityAnnotation mid + * @property {string|null} [locale] EntityAnnotation locale + * @property {string|null} [description] EntityAnnotation description + * @property {number|null} [score] EntityAnnotation score + * @property {number|null} [confidence] EntityAnnotation confidence + * @property {number|null} [topicality] EntityAnnotation topicality + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingPoly] EntityAnnotation boundingPoly + * @property {Array.|null} [locations] EntityAnnotation locations + * @property {Array.|null} [properties] EntityAnnotation properties + */ + + /** + * Constructs a new EntityAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an EntityAnnotation. + * @implements IEntityAnnotation + * @constructor + * @param {google.cloud.vision.v1p3beta1.IEntityAnnotation=} [properties] Properties to set + */ + function EntityAnnotation(properties) { + this.locations = []; + this.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]]; + } + + /** + * EntityAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.mid = ""; + + /** + * EntityAnnotation locale. + * @member {string} locale + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locale = ""; + + /** + * EntityAnnotation description. + * @member {string} description + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.description = ""; + + /** + * EntityAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.score = 0; + + /** + * EntityAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.confidence = 0; + + /** + * EntityAnnotation topicality. + * @member {number} topicality + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.topicality = 0; + + /** + * EntityAnnotation boundingPoly. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.boundingPoly = null; + + /** + * EntityAnnotation locations. + * @member {Array.} locations + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locations = $util.emptyArray; + + /** + * EntityAnnotation properties. + * @member {Array.} properties + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.properties = $util.emptyArray; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IEntityAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.EntityAnnotation} EntityAnnotation instance + */ + EntityAnnotation.create = function create(properties) { + return new EntityAnnotation(properties); + }; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.EntityAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.locale != null && message.hasOwnProperty("locale")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.locale); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.topicality != null && message.hasOwnProperty("topicality")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicality); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.vision.v1p3beta1.LocationInfo.encode(message.locations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.vision.v1p3beta1.Property.encode(message.properties[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.EntityAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.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.vision.v1p3beta1.EntityAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.locale = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.confidence = reader.float(); + break; + case 6: + message.topicality = reader.float(); + break; + case 7: + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.vision.v1p3beta1.LocationInfo.decode(reader, reader.uint32())); + break; + case 9: + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.vision.v1p3beta1.Property.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.locale != null && message.hasOwnProperty("locale")) + if (!$util.isString(message.locale)) + return "locale: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.topicality != null && message.hasOwnProperty("topicality")) + if (typeof message.topicality !== "number") + return "topicality: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.LocationInfo.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates an EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.EntityAnnotation} EntityAnnotation + */ + EntityAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.EntityAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.EntityAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.locale != null) + message.locale = String(object.locale); + if (object.description != null) + message.description = String(object.description); + if (object.score != null) + message.score = Number(object.score); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.topicality != null) + message.topicality = Number(object.topicality); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.EntityAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.vision.v1p3beta1.EntityAnnotation.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.EntityAnnotation.locations: object expected"); + message.locations[i] = $root.google.cloud.vision.v1p3beta1.LocationInfo.fromObject(object.locations[i]); + } + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.vision.v1p3beta1.EntityAnnotation.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.EntityAnnotation.properties: object expected"); + message.properties[i] = $root.google.cloud.vision.v1p3beta1.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.EntityAnnotation} message EntityAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locations = []; + object.properties = []; + } + if (options.defaults) { + object.mid = ""; + object.locale = ""; + object.description = ""; + object.score = 0; + object.confidence = 0; + object.topicality = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.locale != null && message.hasOwnProperty("locale")) + object.locale = message.locale; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.topicality != null && message.hasOwnProperty("topicality")) + object.topicality = options.json && !isFinite(message.topicality) ? String(message.topicality) : message.topicality; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.vision.v1p3beta1.LocationInfo.toObject(message.locations[j], options); + } + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.vision.v1p3beta1.Property.toObject(message.properties[j], options); + } + return object; + }; + + /** + * Converts this EntityAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.EntityAnnotation + * @instance + * @returns {Object.} JSON object + */ + EntityAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EntityAnnotation; + })(); + + v1p3beta1.LocalizedObjectAnnotation = (function() { + + /** + * Properties of a LocalizedObjectAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ILocalizedObjectAnnotation + * @property {string|null} [mid] LocalizedObjectAnnotation mid + * @property {string|null} [languageCode] LocalizedObjectAnnotation languageCode + * @property {string|null} [name] LocalizedObjectAnnotation name + * @property {number|null} [score] LocalizedObjectAnnotation score + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingPoly] LocalizedObjectAnnotation boundingPoly + */ + + /** + * Constructs a new LocalizedObjectAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a LocalizedObjectAnnotation. + * @implements ILocalizedObjectAnnotation + * @constructor + * @param {google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation=} [properties] Properties to set + */ + function LocalizedObjectAnnotation(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]]; + } + + /** + * LocalizedObjectAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.mid = ""; + + /** + * LocalizedObjectAnnotation languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.languageCode = ""; + + /** + * LocalizedObjectAnnotation name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.name = ""; + + /** + * LocalizedObjectAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.score = 0; + + /** + * LocalizedObjectAnnotation boundingPoly. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.boundingPoly = null; + + /** + * Creates a new LocalizedObjectAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation instance + */ + LocalizedObjectAnnotation.create = function create(properties) { + return new LocalizedObjectAnnotation(properties); + }; + + /** + * Encodes the specified LocalizedObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation} message LocalizedObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedObjectAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocalizedObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ILocalizedObjectAnnotation} message LocalizedObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedObjectAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedObjectAnnotation.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.vision.v1p3beta1.LocalizedObjectAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedObjectAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalizedObjectAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalizedObjectAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + return null; + }; + + /** + * Creates a LocalizedObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + */ + LocalizedObjectAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.name != null) + message.name = String(object.name); + if (object.score != null) + message.score = Number(object.score); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingPoly); + } + return message; + }; + + /** + * Creates a plain object from a LocalizedObjectAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation} message LocalizedObjectAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalizedObjectAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mid = ""; + object.languageCode = ""; + object.name = ""; + object.score = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingPoly, options); + return object; + }; + + /** + * Converts this LocalizedObjectAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation + * @instance + * @returns {Object.} JSON object + */ + LocalizedObjectAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocalizedObjectAnnotation; + })(); + + v1p3beta1.SafeSearchAnnotation = (function() { + + /** + * Properties of a SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ISafeSearchAnnotation + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [adult] SafeSearchAnnotation adult + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [spoof] SafeSearchAnnotation spoof + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [medical] SafeSearchAnnotation medical + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [violence] SafeSearchAnnotation violence + * @property {google.cloud.vision.v1p3beta1.Likelihood|null} [racy] SafeSearchAnnotation racy + */ + + /** + * Constructs a new SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a SafeSearchAnnotation. + * @implements ISafeSearchAnnotation + * @constructor + * @param {google.cloud.vision.v1p3beta1.ISafeSearchAnnotation=} [properties] Properties to set + */ + function SafeSearchAnnotation(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]]; + } + + /** + * SafeSearchAnnotation adult. + * @member {google.cloud.vision.v1p3beta1.Likelihood} adult + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.adult = 0; + + /** + * SafeSearchAnnotation spoof. + * @member {google.cloud.vision.v1p3beta1.Likelihood} spoof + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.spoof = 0; + + /** + * SafeSearchAnnotation medical. + * @member {google.cloud.vision.v1p3beta1.Likelihood} medical + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.medical = 0; + + /** + * SafeSearchAnnotation violence. + * @member {google.cloud.vision.v1p3beta1.Likelihood} violence + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.violence = 0; + + /** + * SafeSearchAnnotation racy. + * @member {google.cloud.vision.v1p3beta1.Likelihood} racy + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.racy = 0; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ISafeSearchAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.SafeSearchAnnotation} SafeSearchAnnotation instance + */ + SafeSearchAnnotation.create = function create(properties) { + return new SafeSearchAnnotation(properties); + }; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adult != null && message.hasOwnProperty("adult")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.adult); + if (message.spoof != null && message.hasOwnProperty("spoof")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.spoof); + if (message.medical != null && message.hasOwnProperty("medical")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.medical); + if (message.violence != null && message.hasOwnProperty("violence")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.violence); + if (message.racy != null && message.hasOwnProperty("racy")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.racy); + return writer; + }; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.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.vision.v1p3beta1.SafeSearchAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.adult = reader.int32(); + break; + case 2: + message.spoof = reader.int32(); + break; + case 3: + message.medical = reader.int32(); + break; + case 4: + message.violence = reader.int32(); + break; + case 9: + message.racy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafeSearchAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafeSearchAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adult != null && message.hasOwnProperty("adult")) + switch (message.adult) { + default: + return "adult: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.spoof != null && message.hasOwnProperty("spoof")) + switch (message.spoof) { + default: + return "spoof: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.medical != null && message.hasOwnProperty("medical")) + switch (message.medical) { + default: + return "medical: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.violence != null && message.hasOwnProperty("violence")) + switch (message.violence) { + default: + return "violence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.racy != null && message.hasOwnProperty("racy")) + switch (message.racy) { + default: + return "racy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.SafeSearchAnnotation} SafeSearchAnnotation + */ + SafeSearchAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.SafeSearchAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.SafeSearchAnnotation(); + switch (object.adult) { + case "UNKNOWN": + case 0: + message.adult = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.adult = 1; + break; + case "UNLIKELY": + case 2: + message.adult = 2; + break; + case "POSSIBLE": + case 3: + message.adult = 3; + break; + case "LIKELY": + case 4: + message.adult = 4; + break; + case "VERY_LIKELY": + case 5: + message.adult = 5; + break; + } + switch (object.spoof) { + case "UNKNOWN": + case 0: + message.spoof = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.spoof = 1; + break; + case "UNLIKELY": + case 2: + message.spoof = 2; + break; + case "POSSIBLE": + case 3: + message.spoof = 3; + break; + case "LIKELY": + case 4: + message.spoof = 4; + break; + case "VERY_LIKELY": + case 5: + message.spoof = 5; + break; + } + switch (object.medical) { + case "UNKNOWN": + case 0: + message.medical = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.medical = 1; + break; + case "UNLIKELY": + case 2: + message.medical = 2; + break; + case "POSSIBLE": + case 3: + message.medical = 3; + break; + case "LIKELY": + case 4: + message.medical = 4; + break; + case "VERY_LIKELY": + case 5: + message.medical = 5; + break; + } + switch (object.violence) { + case "UNKNOWN": + case 0: + message.violence = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.violence = 1; + break; + case "UNLIKELY": + case 2: + message.violence = 2; + break; + case "POSSIBLE": + case 3: + message.violence = 3; + break; + case "LIKELY": + case 4: + message.violence = 4; + break; + case "VERY_LIKELY": + case 5: + message.violence = 5; + break; + } + switch (object.racy) { + case "UNKNOWN": + case 0: + message.racy = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.racy = 1; + break; + case "UNLIKELY": + case 2: + message.racy = 2; + break; + case "POSSIBLE": + case 3: + message.racy = 3; + break; + case "LIKELY": + case 4: + message.racy = 4; + break; + case "VERY_LIKELY": + case 5: + message.racy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.SafeSearchAnnotation} message SafeSearchAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafeSearchAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adult = options.enums === String ? "UNKNOWN" : 0; + object.spoof = options.enums === String ? "UNKNOWN" : 0; + object.medical = options.enums === String ? "UNKNOWN" : 0; + object.violence = options.enums === String ? "UNKNOWN" : 0; + object.racy = options.enums === String ? "UNKNOWN" : 0; + } + if (message.adult != null && message.hasOwnProperty("adult")) + object.adult = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.adult] : message.adult; + if (message.spoof != null && message.hasOwnProperty("spoof")) + object.spoof = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.spoof] : message.spoof; + if (message.medical != null && message.hasOwnProperty("medical")) + object.medical = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.medical] : message.medical; + if (message.violence != null && message.hasOwnProperty("violence")) + object.violence = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.violence] : message.violence; + if (message.racy != null && message.hasOwnProperty("racy")) + object.racy = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Likelihood[message.racy] : message.racy; + return object; + }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.SafeSearchAnnotation + * @instance + * @returns {Object.} JSON object + */ + SafeSearchAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SafeSearchAnnotation; + })(); + + v1p3beta1.LatLongRect = (function() { + + /** + * Properties of a LatLongRect. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ILatLongRect + * @property {google.type.ILatLng|null} [minLatLng] LatLongRect minLatLng + * @property {google.type.ILatLng|null} [maxLatLng] LatLongRect maxLatLng + */ + + /** + * Constructs a new LatLongRect. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a LatLongRect. + * @implements ILatLongRect + * @constructor + * @param {google.cloud.vision.v1p3beta1.ILatLongRect=} [properties] Properties to set + */ + function LatLongRect(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]]; + } + + /** + * LatLongRect minLatLng. + * @member {google.type.ILatLng|null|undefined} minLatLng + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.minLatLng = null; + + /** + * LatLongRect maxLatLng. + * @member {google.type.ILatLng|null|undefined} maxLatLng + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.maxLatLng = null; + + /** + * Creates a new LatLongRect instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p3beta1.ILatLongRect=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.LatLongRect} LatLongRect instance + */ + LatLongRect.create = function create(properties) { + return new LatLongRect(properties); + }; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p3beta1.LatLongRect.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p3beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + $root.google.type.LatLng.encode(message.minLatLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + $root.google.type.LatLng.encode(message.maxLatLng, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.LatLongRect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p3beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.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.vision.v1p3beta1.LatLongRect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 2: + message.maxLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLongRect message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLongRect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) { + var error = $root.google.type.LatLng.verify(message.minLatLng); + if (error) + return "minLatLng." + error; + } + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) { + var error = $root.google.type.LatLng.verify(message.maxLatLng); + if (error) + return "maxLatLng." + error; + } + return null; + }; + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.LatLongRect} LatLongRect + */ + LatLongRect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.LatLongRect) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.LatLongRect(); + if (object.minLatLng != null) { + if (typeof object.minLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.LatLongRect.minLatLng: object expected"); + message.minLatLng = $root.google.type.LatLng.fromObject(object.minLatLng); + } + if (object.maxLatLng != null) { + if (typeof object.maxLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.LatLongRect.maxLatLng: object expected"); + message.maxLatLng = $root.google.type.LatLng.fromObject(object.maxLatLng); + } + return message; + }; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p3beta1.LatLongRect} message LatLongRect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLongRect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minLatLng = null; + object.maxLatLng = null; + } + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + object.minLatLng = $root.google.type.LatLng.toObject(message.minLatLng, options); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + object.maxLatLng = $root.google.type.LatLng.toObject(message.maxLatLng, options); + return object; + }; + + /** + * Converts this LatLongRect to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.LatLongRect + * @instance + * @returns {Object.} JSON object + */ + LatLongRect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LatLongRect; + })(); + + v1p3beta1.ColorInfo = (function() { + + /** + * Properties of a ColorInfo. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IColorInfo + * @property {google.type.IColor|null} [color] ColorInfo color + * @property {number|null} [score] ColorInfo score + * @property {number|null} [pixelFraction] ColorInfo pixelFraction + */ + + /** + * Constructs a new ColorInfo. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ColorInfo. + * @implements IColorInfo + * @constructor + * @param {google.cloud.vision.v1p3beta1.IColorInfo=} [properties] Properties to set + */ + function ColorInfo(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]]; + } + + /** + * ColorInfo color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.color = null; + + /** + * ColorInfo score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.score = 0; + + /** + * ColorInfo pixelFraction. + * @member {number} pixelFraction + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.pixelFraction = 0; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p3beta1.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ColorInfo} ColorInfo instance + */ + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); + }; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ColorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p3beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.color != null && message.hasOwnProperty("color")) + $root.google.type.Color.encode(message.color, 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); + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.pixelFraction); + return writer; + }; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ColorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p3beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.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.vision.v1p3beta1.ColorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.color = $root.google.type.Color.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pixelFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColorInfo message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + if (typeof message.pixelFraction !== "number") + return "pixelFraction: number expected"; + return null; + }; + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ColorInfo} ColorInfo + */ + ColorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ColorInfo) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ColorInfo(); + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ColorInfo.color: object expected"); + message.color = $root.google.type.Color.fromObject(object.color); + } + if (object.score != null) + message.score = Number(object.score); + if (object.pixelFraction != null) + message.pixelFraction = Number(object.pixelFraction); + return message; + }; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ColorInfo} message ColorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.color = null; + object.score = 0; + object.pixelFraction = 0; + } + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.type.Color.toObject(message.color, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + object.pixelFraction = options.json && !isFinite(message.pixelFraction) ? String(message.pixelFraction) : message.pixelFraction; + return object; + }; + + /** + * Converts this ColorInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ColorInfo + * @instance + * @returns {Object.} JSON object + */ + ColorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ColorInfo; + })(); + + v1p3beta1.DominantColorsAnnotation = (function() { + + /** + * Properties of a DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IDominantColorsAnnotation + * @property {Array.|null} [colors] DominantColorsAnnotation colors + */ + + /** + * Constructs a new DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a DominantColorsAnnotation. + * @implements IDominantColorsAnnotation + * @constructor + * @param {google.cloud.vision.v1p3beta1.IDominantColorsAnnotation=} [properties] Properties to set + */ + function DominantColorsAnnotation(properties) { + this.colors = []; + 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]]; + } + + /** + * DominantColorsAnnotation colors. + * @member {Array.} colors + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @instance + */ + DominantColorsAnnotation.prototype.colors = $util.emptyArray; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IDominantColorsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.DominantColorsAnnotation} DominantColorsAnnotation instance + */ + DominantColorsAnnotation.create = function create(properties) { + return new DominantColorsAnnotation(properties); + }; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.colors != null && message.colors.length) + for (var i = 0; i < message.colors.length; ++i) + $root.google.cloud.vision.v1p3beta1.ColorInfo.encode(message.colors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.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.vision.v1p3beta1.DominantColorsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.colors && message.colors.length)) + message.colors = []; + message.colors.push($root.google.cloud.vision.v1p3beta1.ColorInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominantColorsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominantColorsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.colors != null && message.hasOwnProperty("colors")) { + if (!Array.isArray(message.colors)) + return "colors: array expected"; + for (var i = 0; i < message.colors.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.ColorInfo.verify(message.colors[i]); + if (error) + return "colors." + error; + } + } + return null; + }; + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.DominantColorsAnnotation} DominantColorsAnnotation + */ + DominantColorsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.DominantColorsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.DominantColorsAnnotation(); + if (object.colors) { + if (!Array.isArray(object.colors)) + throw TypeError(".google.cloud.vision.v1p3beta1.DominantColorsAnnotation.colors: array expected"); + message.colors = []; + for (var i = 0; i < object.colors.length; ++i) { + if (typeof object.colors[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.DominantColorsAnnotation.colors: object expected"); + message.colors[i] = $root.google.cloud.vision.v1p3beta1.ColorInfo.fromObject(object.colors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.DominantColorsAnnotation} message DominantColorsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominantColorsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.colors = []; + if (message.colors && message.colors.length) { + object.colors = []; + for (var j = 0; j < message.colors.length; ++j) + object.colors[j] = $root.google.cloud.vision.v1p3beta1.ColorInfo.toObject(message.colors[j], options); + } + return object; + }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.DominantColorsAnnotation + * @instance + * @returns {Object.} JSON object + */ + DominantColorsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominantColorsAnnotation; + })(); + + v1p3beta1.ImageProperties = (function() { + + /** + * Properties of an ImageProperties. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImageProperties + * @property {google.cloud.vision.v1p3beta1.IDominantColorsAnnotation|null} [dominantColors] ImageProperties dominantColors + */ + + /** + * Constructs a new ImageProperties. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImageProperties. + * @implements IImageProperties + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImageProperties=} [properties] Properties to set + */ + function ImageProperties(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]]; + } + + /** + * ImageProperties dominantColors. + * @member {google.cloud.vision.v1p3beta1.IDominantColorsAnnotation|null|undefined} dominantColors + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @instance + */ + ImageProperties.prototype.dominantColors = null; + + /** + * Creates a new ImageProperties instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p3beta1.IImageProperties=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImageProperties} ImageProperties instance + */ + ImageProperties.create = function create(properties) { + return new ImageProperties(properties); + }; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p3beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + $root.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.encode(message.dominantColors, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p3beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.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.vision.v1p3beta1.ImageProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dominantColors = $root.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageProperties message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) { + var error = $root.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.verify(message.dominantColors); + if (error) + return "dominantColors." + error; + } + return null; + }; + + /** + * Creates an ImageProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImageProperties} ImageProperties + */ + ImageProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImageProperties) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImageProperties(); + if (object.dominantColors != null) { + if (typeof object.dominantColors !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImageProperties.dominantColors: object expected"); + message.dominantColors = $root.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.fromObject(object.dominantColors); + } + return message; + }; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p3beta1.ImageProperties} message ImageProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dominantColors = null; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + object.dominantColors = $root.google.cloud.vision.v1p3beta1.DominantColorsAnnotation.toObject(message.dominantColors, options); + return object; + }; + + /** + * Converts this ImageProperties to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImageProperties + * @instance + * @returns {Object.} JSON object + */ + ImageProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageProperties; + })(); + + v1p3beta1.CropHint = (function() { + + /** + * Properties of a CropHint. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ICropHint + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingPoly] CropHint boundingPoly + * @property {number|null} [confidence] CropHint confidence + * @property {number|null} [importanceFraction] CropHint importanceFraction + */ + + /** + * Constructs a new CropHint. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a CropHint. + * @implements ICropHint + * @constructor + * @param {google.cloud.vision.v1p3beta1.ICropHint=} [properties] Properties to set + */ + function CropHint(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]]; + } + + /** + * CropHint boundingPoly. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @instance + */ + CropHint.prototype.boundingPoly = null; + + /** + * CropHint confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @instance + */ + CropHint.prototype.confidence = 0; + + /** + * CropHint importanceFraction. + * @member {number} importanceFraction + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @instance + */ + CropHint.prototype.importanceFraction = 0; + + /** + * Creates a new CropHint instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHint=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.CropHint} CropHint instance + */ + CropHint.create = function create(properties) { + return new CropHint(properties); + }; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHint.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.importanceFraction); + return writer; + }; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.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.vision.v1p3beta1.CropHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.importanceFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHint message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + if (typeof message.importanceFraction !== "number") + return "importanceFraction: number expected"; + return null; + }; + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.CropHint} CropHint + */ + CropHint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.CropHint) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.CropHint(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.CropHint.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.importanceFraction != null) + message.importanceFraction = Number(object.importanceFraction); + return message; + }; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @static + * @param {google.cloud.vision.v1p3beta1.CropHint} message CropHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingPoly = null; + object.confidence = 0; + object.importanceFraction = 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + object.importanceFraction = options.json && !isFinite(message.importanceFraction) ? String(message.importanceFraction) : message.importanceFraction; + return object; + }; + + /** + * Converts this CropHint to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.CropHint + * @instance + * @returns {Object.} JSON object + */ + CropHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHint; + })(); + + v1p3beta1.CropHintsAnnotation = (function() { + + /** + * Properties of a CropHintsAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ICropHintsAnnotation + * @property {Array.|null} [cropHints] CropHintsAnnotation cropHints + */ + + /** + * Constructs a new CropHintsAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a CropHintsAnnotation. + * @implements ICropHintsAnnotation + * @constructor + * @param {google.cloud.vision.v1p3beta1.ICropHintsAnnotation=} [properties] Properties to set + */ + function CropHintsAnnotation(properties) { + this.cropHints = []; + 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]]; + } + + /** + * CropHintsAnnotation cropHints. + * @member {Array.} cropHints + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @instance + */ + CropHintsAnnotation.prototype.cropHints = $util.emptyArray; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHintsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.CropHintsAnnotation} CropHintsAnnotation instance + */ + CropHintsAnnotation.create = function create(properties) { + return new CropHintsAnnotation(properties); + }; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cropHints != null && message.cropHints.length) + for (var i = 0; i < message.cropHints.length; ++i) + $root.google.cloud.vision.v1p3beta1.CropHint.encode(message.cropHints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.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.vision.v1p3beta1.CropHintsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cropHints && message.cropHints.length)) + message.cropHints = []; + message.cropHints.push($root.google.cloud.vision.v1p3beta1.CropHint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cropHints != null && message.hasOwnProperty("cropHints")) { + if (!Array.isArray(message.cropHints)) + return "cropHints: array expected"; + for (var i = 0; i < message.cropHints.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.CropHint.verify(message.cropHints[i]); + if (error) + return "cropHints." + error; + } + } + return null; + }; + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.CropHintsAnnotation} CropHintsAnnotation + */ + CropHintsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.CropHintsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.CropHintsAnnotation(); + if (object.cropHints) { + if (!Array.isArray(object.cropHints)) + throw TypeError(".google.cloud.vision.v1p3beta1.CropHintsAnnotation.cropHints: array expected"); + message.cropHints = []; + for (var i = 0; i < object.cropHints.length; ++i) { + if (typeof object.cropHints[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.CropHintsAnnotation.cropHints: object expected"); + message.cropHints[i] = $root.google.cloud.vision.v1p3beta1.CropHint.fromObject(object.cropHints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.CropHintsAnnotation} message CropHintsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cropHints = []; + if (message.cropHints && message.cropHints.length) { + object.cropHints = []; + for (var j = 0; j < message.cropHints.length; ++j) + object.cropHints[j] = $root.google.cloud.vision.v1p3beta1.CropHint.toObject(message.cropHints[j], options); + } + return object; + }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.CropHintsAnnotation + * @instance + * @returns {Object.} JSON object + */ + CropHintsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsAnnotation; + })(); + + v1p3beta1.CropHintsParams = (function() { + + /** + * Properties of a CropHintsParams. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ICropHintsParams + * @property {Array.|null} [aspectRatios] CropHintsParams aspectRatios + */ + + /** + * Constructs a new CropHintsParams. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a CropHintsParams. + * @implements ICropHintsParams + * @constructor + * @param {google.cloud.vision.v1p3beta1.ICropHintsParams=} [properties] Properties to set + */ + function CropHintsParams(properties) { + this.aspectRatios = []; + 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]]; + } + + /** + * CropHintsParams aspectRatios. + * @member {Array.} aspectRatios + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @instance + */ + CropHintsParams.prototype.aspectRatios = $util.emptyArray; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHintsParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.CropHintsParams} CropHintsParams instance + */ + CropHintsParams.create = function create(properties) { + return new CropHintsParams(properties); + }; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aspectRatios != null && message.aspectRatios.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.aspectRatios.length; ++i) + writer.float(message.aspectRatios[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CropHintsParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p3beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.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.vision.v1p3beta1.CropHintsParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.aspectRatios && message.aspectRatios.length)) + message.aspectRatios = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.aspectRatios.push(reader.float()); + } else + message.aspectRatios.push(reader.float()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsParams message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aspectRatios != null && message.hasOwnProperty("aspectRatios")) { + if (!Array.isArray(message.aspectRatios)) + return "aspectRatios: array expected"; + for (var i = 0; i < message.aspectRatios.length; ++i) + if (typeof message.aspectRatios[i] !== "number") + return "aspectRatios: number[] expected"; + } + return null; + }; + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.CropHintsParams} CropHintsParams + */ + CropHintsParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.CropHintsParams) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.CropHintsParams(); + if (object.aspectRatios) { + if (!Array.isArray(object.aspectRatios)) + throw TypeError(".google.cloud.vision.v1p3beta1.CropHintsParams.aspectRatios: array expected"); + message.aspectRatios = []; + for (var i = 0; i < object.aspectRatios.length; ++i) + message.aspectRatios[i] = Number(object.aspectRatios[i]); + } + return message; + }; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p3beta1.CropHintsParams} message CropHintsParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aspectRatios = []; + if (message.aspectRatios && message.aspectRatios.length) { + object.aspectRatios = []; + for (var j = 0; j < message.aspectRatios.length; ++j) + object.aspectRatios[j] = options.json && !isFinite(message.aspectRatios[j]) ? String(message.aspectRatios[j]) : message.aspectRatios[j]; + } + return object; + }; + + /** + * Converts this CropHintsParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.CropHintsParams + * @instance + * @returns {Object.} JSON object + */ + CropHintsParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsParams; + })(); + + v1p3beta1.WebDetectionParams = (function() { + + /** + * Properties of a WebDetectionParams. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IWebDetectionParams + * @property {boolean|null} [includeGeoResults] WebDetectionParams includeGeoResults + */ + + /** + * Constructs a new WebDetectionParams. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a WebDetectionParams. + * @implements IWebDetectionParams + * @constructor + * @param {google.cloud.vision.v1p3beta1.IWebDetectionParams=} [properties] Properties to set + */ + function WebDetectionParams(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]]; + } + + /** + * WebDetectionParams includeGeoResults. + * @member {boolean} includeGeoResults + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @instance + */ + WebDetectionParams.prototype.includeGeoResults = false; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p3beta1.IWebDetectionParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.WebDetectionParams} WebDetectionParams instance + */ + WebDetectionParams.create = function create(properties) { + return new WebDetectionParams(properties); + }; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p3beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeGeoResults); + return writer; + }; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p3beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.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.vision.v1p3beta1.WebDetectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.includeGeoResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetectionParams message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetectionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + if (typeof message.includeGeoResults !== "boolean") + return "includeGeoResults: boolean expected"; + return null; + }; + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.WebDetectionParams} WebDetectionParams + */ + WebDetectionParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.WebDetectionParams) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.WebDetectionParams(); + if (object.includeGeoResults != null) + message.includeGeoResults = Boolean(object.includeGeoResults); + return message; + }; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetectionParams} message WebDetectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.includeGeoResults = false; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + object.includeGeoResults = message.includeGeoResults; + return object; + }; + + /** + * Converts this WebDetectionParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.WebDetectionParams + * @instance + * @returns {Object.} JSON object + */ + WebDetectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebDetectionParams; + })(); + + v1p3beta1.ImageContext = (function() { + + /** + * Properties of an ImageContext. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImageContext + * @property {google.cloud.vision.v1p3beta1.ILatLongRect|null} [latLongRect] ImageContext latLongRect + * @property {Array.|null} [languageHints] ImageContext languageHints + * @property {google.cloud.vision.v1p3beta1.ICropHintsParams|null} [cropHintsParams] ImageContext cropHintsParams + * @property {google.cloud.vision.v1p3beta1.IProductSearchParams|null} [productSearchParams] ImageContext productSearchParams + * @property {google.cloud.vision.v1p3beta1.IWebDetectionParams|null} [webDetectionParams] ImageContext webDetectionParams + */ + + /** + * Constructs a new ImageContext. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImageContext. + * @implements IImageContext + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImageContext=} [properties] Properties to set + */ + function ImageContext(properties) { + this.languageHints = []; + 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]]; + } + + /** + * ImageContext latLongRect. + * @member {google.cloud.vision.v1p3beta1.ILatLongRect|null|undefined} latLongRect + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @instance + */ + ImageContext.prototype.latLongRect = null; + + /** + * ImageContext languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @instance + */ + ImageContext.prototype.languageHints = $util.emptyArray; + + /** + * ImageContext cropHintsParams. + * @member {google.cloud.vision.v1p3beta1.ICropHintsParams|null|undefined} cropHintsParams + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @instance + */ + ImageContext.prototype.cropHintsParams = null; + + /** + * ImageContext productSearchParams. + * @member {google.cloud.vision.v1p3beta1.IProductSearchParams|null|undefined} productSearchParams + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @instance + */ + ImageContext.prototype.productSearchParams = null; + + /** + * ImageContext webDetectionParams. + * @member {google.cloud.vision.v1p3beta1.IWebDetectionParams|null|undefined} webDetectionParams + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @instance + */ + ImageContext.prototype.webDetectionParams = null; + + /** + * Creates a new ImageContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p3beta1.IImageContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImageContext} ImageContext instance + */ + ImageContext.create = function create(properties) { + return new ImageContext(properties); + }; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p3beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + $root.google.cloud.vision.v1p3beta1.LatLongRect.encode(message.latLongRect, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageHints[i]); + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + $root.google.cloud.vision.v1p3beta1.CropHintsParams.encode(message.cropHintsParams, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) + $root.google.cloud.vision.v1p3beta1.ProductSearchParams.encode(message.productSearchParams, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + $root.google.cloud.vision.v1p3beta1.WebDetectionParams.encode(message.webDetectionParams, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p3beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.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.vision.v1p3beta1.ImageContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLongRect = $root.google.cloud.vision.v1p3beta1.LatLongRect.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + case 4: + message.cropHintsParams = $root.google.cloud.vision.v1p3beta1.CropHintsParams.decode(reader, reader.uint32()); + break; + case 5: + message.productSearchParams = $root.google.cloud.vision.v1p3beta1.ProductSearchParams.decode(reader, reader.uint32()); + break; + case 6: + message.webDetectionParams = $root.google.cloud.vision.v1p3beta1.WebDetectionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageContext message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) { + var error = $root.google.cloud.vision.v1p3beta1.LatLongRect.verify(message.latLongRect); + if (error) + return "latLongRect." + error; + } + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) { + var error = $root.google.cloud.vision.v1p3beta1.CropHintsParams.verify(message.cropHintsParams); + if (error) + return "cropHintsParams." + error; + } + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) { + var error = $root.google.cloud.vision.v1p3beta1.ProductSearchParams.verify(message.productSearchParams); + if (error) + return "productSearchParams." + error; + } + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetectionParams.verify(message.webDetectionParams); + if (error) + return "webDetectionParams." + error; + } + return null; + }; + + /** + * Creates an ImageContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImageContext} ImageContext + */ + ImageContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImageContext) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImageContext(); + if (object.latLongRect != null) { + if (typeof object.latLongRect !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImageContext.latLongRect: object expected"); + message.latLongRect = $root.google.cloud.vision.v1p3beta1.LatLongRect.fromObject(object.latLongRect); + } + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.vision.v1p3beta1.ImageContext.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + if (object.cropHintsParams != null) { + if (typeof object.cropHintsParams !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImageContext.cropHintsParams: object expected"); + message.cropHintsParams = $root.google.cloud.vision.v1p3beta1.CropHintsParams.fromObject(object.cropHintsParams); + } + if (object.productSearchParams != null) { + if (typeof object.productSearchParams !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImageContext.productSearchParams: object expected"); + message.productSearchParams = $root.google.cloud.vision.v1p3beta1.ProductSearchParams.fromObject(object.productSearchParams); + } + if (object.webDetectionParams != null) { + if (typeof object.webDetectionParams !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImageContext.webDetectionParams: object expected"); + message.webDetectionParams = $root.google.cloud.vision.v1p3beta1.WebDetectionParams.fromObject(object.webDetectionParams); + } + return message; + }; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p3beta1.ImageContext} message ImageContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (options.defaults) { + object.latLongRect = null; + object.cropHintsParams = null; + object.productSearchParams = null; + object.webDetectionParams = null; + } + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + object.latLongRect = $root.google.cloud.vision.v1p3beta1.LatLongRect.toObject(message.latLongRect, options); + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + object.cropHintsParams = $root.google.cloud.vision.v1p3beta1.CropHintsParams.toObject(message.cropHintsParams, options); + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) + object.productSearchParams = $root.google.cloud.vision.v1p3beta1.ProductSearchParams.toObject(message.productSearchParams, options); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + object.webDetectionParams = $root.google.cloud.vision.v1p3beta1.WebDetectionParams.toObject(message.webDetectionParams, options); + return object; + }; + + /** + * Converts this ImageContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImageContext + * @instance + * @returns {Object.} JSON object + */ + ImageContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageContext; + })(); + + v1p3beta1.AnnotateImageRequest = (function() { + + /** + * Properties of an AnnotateImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAnnotateImageRequest + * @property {google.cloud.vision.v1p3beta1.IImage|null} [image] AnnotateImageRequest image + * @property {Array.|null} [features] AnnotateImageRequest features + * @property {google.cloud.vision.v1p3beta1.IImageContext|null} [imageContext] AnnotateImageRequest imageContext + */ + + /** + * Constructs a new AnnotateImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AnnotateImageRequest. + * @implements IAnnotateImageRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageRequest=} [properties] Properties to set + */ + function AnnotateImageRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AnnotateImageRequest image. + * @member {google.cloud.vision.v1p3beta1.IImage|null|undefined} image + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.image = null; + + /** + * AnnotateImageRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateImageRequest imageContext. + * @member {google.cloud.vision.v1p3beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.imageContext = null; + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageRequest} AnnotateImageRequest instance + */ + AnnotateImageRequest.create = function create(properties) { + return new AnnotateImageRequest(properties); + }; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && message.hasOwnProperty("image")) + $root.google.cloud.vision.v1p3beta1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p3beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p3beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.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.vision.v1p3beta1.AnnotateImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = $root.google.cloud.vision.v1p3beta1.Image.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p3beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p3beta1.ImageContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.vision.v1p3beta1.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p3beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageRequest} AnnotateImageRequest + */ + AnnotateImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AnnotateImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AnnotateImageRequest(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageRequest.image: object expected"); + message.image = $root.google.cloud.vision.v1p3beta1.Image.fromObject(object.image); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p3beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p3beta1.ImageContext.fromObject(object.imageContext); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.AnnotateImageRequest} message AnnotateImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.image = null; + object.imageContext = null; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.vision.v1p3beta1.Image.toObject(message.image, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p3beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p3beta1.ImageContext.toObject(message.imageContext, options); + return object; + }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageRequest; + })(); + + v1p3beta1.ImageAnnotationContext = (function() { + + /** + * Properties of an ImageAnnotationContext. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImageAnnotationContext + * @property {string|null} [uri] ImageAnnotationContext uri + * @property {number|null} [pageNumber] ImageAnnotationContext pageNumber + */ + + /** + * Constructs a new ImageAnnotationContext. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImageAnnotationContext. + * @implements IImageAnnotationContext + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImageAnnotationContext=} [properties] Properties to set + */ + function ImageAnnotationContext(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]]; + } + + /** + * ImageAnnotationContext uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.uri = ""; + + /** + * ImageAnnotationContext pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.pageNumber = 0; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p3beta1.IImageAnnotationContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImageAnnotationContext} ImageAnnotationContext instance + */ + ImageAnnotationContext.create = function create(properties) { + return new ImageAnnotationContext(properties); + }; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageAnnotationContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p3beta1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + return writer; + }; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImageAnnotationContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p3beta1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.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.vision.v1p3beta1.ImageAnnotationContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + message.pageNumber = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageAnnotationContext message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageAnnotationContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + return null; + }; + + /** + * Creates an ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImageAnnotationContext} ImageAnnotationContext + */ + ImageAnnotationContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImageAnnotationContext) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImageAnnotationContext(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + return message; + }; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p3beta1.ImageAnnotationContext} message ImageAnnotationContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageAnnotationContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.pageNumber = 0; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + return object; + }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImageAnnotationContext + * @instance + * @returns {Object.} JSON object + */ + ImageAnnotationContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageAnnotationContext; + })(); + + v1p3beta1.AnnotateImageResponse = (function() { + + /** + * Properties of an AnnotateImageResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAnnotateImageResponse + * @property {Array.|null} [faceAnnotations] AnnotateImageResponse faceAnnotations + * @property {Array.|null} [landmarkAnnotations] AnnotateImageResponse landmarkAnnotations + * @property {Array.|null} [logoAnnotations] AnnotateImageResponse logoAnnotations + * @property {Array.|null} [labelAnnotations] AnnotateImageResponse labelAnnotations + * @property {Array.|null} [localizedObjectAnnotations] AnnotateImageResponse localizedObjectAnnotations + * @property {Array.|null} [textAnnotations] AnnotateImageResponse textAnnotations + * @property {google.cloud.vision.v1p3beta1.ITextAnnotation|null} [fullTextAnnotation] AnnotateImageResponse fullTextAnnotation + * @property {google.cloud.vision.v1p3beta1.ISafeSearchAnnotation|null} [safeSearchAnnotation] AnnotateImageResponse safeSearchAnnotation + * @property {google.cloud.vision.v1p3beta1.IImageProperties|null} [imagePropertiesAnnotation] AnnotateImageResponse imagePropertiesAnnotation + * @property {google.cloud.vision.v1p3beta1.ICropHintsAnnotation|null} [cropHintsAnnotation] AnnotateImageResponse cropHintsAnnotation + * @property {google.cloud.vision.v1p3beta1.IWebDetection|null} [webDetection] AnnotateImageResponse webDetection + * @property {google.cloud.vision.v1p3beta1.IProductSearchResults|null} [productSearchResults] AnnotateImageResponse productSearchResults + * @property {google.rpc.IStatus|null} [error] AnnotateImageResponse error + * @property {google.cloud.vision.v1p3beta1.IImageAnnotationContext|null} [context] AnnotateImageResponse context + */ + + /** + * Constructs a new AnnotateImageResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AnnotateImageResponse. + * @implements IAnnotateImageResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageResponse=} [properties] Properties to set + */ + function AnnotateImageResponse(properties) { + this.faceAnnotations = []; + this.landmarkAnnotations = []; + this.logoAnnotations = []; + this.labelAnnotations = []; + this.localizedObjectAnnotations = []; + this.textAnnotations = []; + 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]]; + } + + /** + * AnnotateImageResponse faceAnnotations. + * @member {Array.} faceAnnotations + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.faceAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse landmarkAnnotations. + * @member {Array.} landmarkAnnotations + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.landmarkAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse logoAnnotations. + * @member {Array.} logoAnnotations + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.logoAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse labelAnnotations. + * @member {Array.} labelAnnotations + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.labelAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse localizedObjectAnnotations. + * @member {Array.} localizedObjectAnnotations + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.localizedObjectAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.textAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse fullTextAnnotation. + * @member {google.cloud.vision.v1p3beta1.ITextAnnotation|null|undefined} fullTextAnnotation + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.fullTextAnnotation = null; + + /** + * AnnotateImageResponse safeSearchAnnotation. + * @member {google.cloud.vision.v1p3beta1.ISafeSearchAnnotation|null|undefined} safeSearchAnnotation + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.safeSearchAnnotation = null; + + /** + * AnnotateImageResponse imagePropertiesAnnotation. + * @member {google.cloud.vision.v1p3beta1.IImageProperties|null|undefined} imagePropertiesAnnotation + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.imagePropertiesAnnotation = null; + + /** + * AnnotateImageResponse cropHintsAnnotation. + * @member {google.cloud.vision.v1p3beta1.ICropHintsAnnotation|null|undefined} cropHintsAnnotation + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.cropHintsAnnotation = null; + + /** + * AnnotateImageResponse webDetection. + * @member {google.cloud.vision.v1p3beta1.IWebDetection|null|undefined} webDetection + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.webDetection = null; + + /** + * AnnotateImageResponse productSearchResults. + * @member {google.cloud.vision.v1p3beta1.IProductSearchResults|null|undefined} productSearchResults + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.productSearchResults = null; + + /** + * AnnotateImageResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.error = null; + + /** + * AnnotateImageResponse context. + * @member {google.cloud.vision.v1p3beta1.IImageAnnotationContext|null|undefined} context + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.context = null; + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageResponse} AnnotateImageResponse instance + */ + AnnotateImageResponse.create = function create(properties) { + return new AnnotateImageResponse(properties); + }; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faceAnnotations != null && message.faceAnnotations.length) + for (var i = 0; i < message.faceAnnotations.length; ++i) + $root.google.cloud.vision.v1p3beta1.FaceAnnotation.encode(message.faceAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.landmarkAnnotations != null && message.landmarkAnnotations.length) + for (var i = 0; i < message.landmarkAnnotations.length; ++i) + $root.google.cloud.vision.v1p3beta1.EntityAnnotation.encode(message.landmarkAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.logoAnnotations != null && message.logoAnnotations.length) + for (var i = 0; i < message.logoAnnotations.length; ++i) + $root.google.cloud.vision.v1p3beta1.EntityAnnotation.encode(message.logoAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labelAnnotations != null && message.labelAnnotations.length) + for (var i = 0; i < message.labelAnnotations.length; ++i) + $root.google.cloud.vision.v1p3beta1.EntityAnnotation.encode(message.labelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.vision.v1p3beta1.EntityAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + $root.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.encode(message.safeSearchAnnotation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + $root.google.cloud.vision.v1p3beta1.ImageProperties.encode(message.imagePropertiesAnnotation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + $root.google.cloud.vision.v1p3beta1.CropHintsAnnotation.encode(message.cropHintsAnnotation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.encode(message.fullTextAnnotation, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + $root.google.cloud.vision.v1p3beta1.WebDetection.encode(message.webDetection, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) + $root.google.cloud.vision.v1p3beta1.ProductSearchResults.encode(message.productSearchResults, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.context != null && message.hasOwnProperty("context")) + $root.google.cloud.vision.v1p3beta1.ImageAnnotationContext.encode(message.context, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.localizedObjectAnnotations != null && message.localizedObjectAnnotations.length) + for (var i = 0; i < message.localizedObjectAnnotations.length; ++i) + $root.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.encode(message.localizedObjectAnnotations[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateImageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.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.vision.v1p3beta1.AnnotateImageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.faceAnnotations && message.faceAnnotations.length)) + message.faceAnnotations = []; + message.faceAnnotations.push($root.google.cloud.vision.v1p3beta1.FaceAnnotation.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.landmarkAnnotations && message.landmarkAnnotations.length)) + message.landmarkAnnotations = []; + message.landmarkAnnotations.push($root.google.cloud.vision.v1p3beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.logoAnnotations && message.logoAnnotations.length)) + message.logoAnnotations = []; + message.logoAnnotations.push($root.google.cloud.vision.v1p3beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.labelAnnotations && message.labelAnnotations.length)) + message.labelAnnotations = []; + message.labelAnnotations.push($root.google.cloud.vision.v1p3beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 22: + if (!(message.localizedObjectAnnotations && message.localizedObjectAnnotations.length)) + message.localizedObjectAnnotations = []; + message.localizedObjectAnnotations.push($root.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.vision.v1p3beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 12: + message.fullTextAnnotation = $root.google.cloud.vision.v1p3beta1.TextAnnotation.decode(reader, reader.uint32()); + break; + case 6: + message.safeSearchAnnotation = $root.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.decode(reader, reader.uint32()); + break; + case 8: + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p3beta1.ImageProperties.decode(reader, reader.uint32()); + break; + case 11: + message.cropHintsAnnotation = $root.google.cloud.vision.v1p3beta1.CropHintsAnnotation.decode(reader, reader.uint32()); + break; + case 13: + message.webDetection = $root.google.cloud.vision.v1p3beta1.WebDetection.decode(reader, reader.uint32()); + break; + case 14: + message.productSearchResults = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.decode(reader, reader.uint32()); + break; + case 9: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 21: + message.context = $root.google.cloud.vision.v1p3beta1.ImageAnnotationContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faceAnnotations != null && message.hasOwnProperty("faceAnnotations")) { + if (!Array.isArray(message.faceAnnotations)) + return "faceAnnotations: array expected"; + for (var i = 0; i < message.faceAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.FaceAnnotation.verify(message.faceAnnotations[i]); + if (error) + return "faceAnnotations." + error; + } + } + if (message.landmarkAnnotations != null && message.hasOwnProperty("landmarkAnnotations")) { + if (!Array.isArray(message.landmarkAnnotations)) + return "landmarkAnnotations: array expected"; + for (var i = 0; i < message.landmarkAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.verify(message.landmarkAnnotations[i]); + if (error) + return "landmarkAnnotations." + error; + } + } + if (message.logoAnnotations != null && message.hasOwnProperty("logoAnnotations")) { + if (!Array.isArray(message.logoAnnotations)) + return "logoAnnotations: array expected"; + for (var i = 0; i < message.logoAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.verify(message.logoAnnotations[i]); + if (error) + return "logoAnnotations." + error; + } + } + if (message.labelAnnotations != null && message.hasOwnProperty("labelAnnotations")) { + if (!Array.isArray(message.labelAnnotations)) + return "labelAnnotations: array expected"; + for (var i = 0; i < message.labelAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.verify(message.labelAnnotations[i]); + if (error) + return "labelAnnotations." + error; + } + } + if (message.localizedObjectAnnotations != null && message.hasOwnProperty("localizedObjectAnnotations")) { + if (!Array.isArray(message.localizedObjectAnnotations)) + return "localizedObjectAnnotations: array expected"; + for (var i = 0; i < message.localizedObjectAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.verify(message.localizedObjectAnnotations[i]); + if (error) + return "localizedObjectAnnotations." + error; + } + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.verify(message.fullTextAnnotation); + if (error) + return "fullTextAnnotation." + error; + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) { + var error = $root.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.verify(message.safeSearchAnnotation); + if (error) + return "safeSearchAnnotation." + error; + } + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) { + var error = $root.google.cloud.vision.v1p3beta1.ImageProperties.verify(message.imagePropertiesAnnotation); + if (error) + return "imagePropertiesAnnotation." + error; + } + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) { + var error = $root.google.cloud.vision.v1p3beta1.CropHintsAnnotation.verify(message.cropHintsAnnotation); + if (error) + return "cropHintsAnnotation." + error; + } + if (message.webDetection != null && message.hasOwnProperty("webDetection")) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.verify(message.webDetection); + if (error) + return "webDetection." + error; + } + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) { + var error = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.verify(message.productSearchResults); + if (error) + return "productSearchResults." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.vision.v1p3beta1.ImageAnnotationContext.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AnnotateImageResponse} AnnotateImageResponse + */ + AnnotateImageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse(); + if (object.faceAnnotations) { + if (!Array.isArray(object.faceAnnotations)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.faceAnnotations: array expected"); + message.faceAnnotations = []; + for (var i = 0; i < object.faceAnnotations.length; ++i) { + if (typeof object.faceAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.faceAnnotations: object expected"); + message.faceAnnotations[i] = $root.google.cloud.vision.v1p3beta1.FaceAnnotation.fromObject(object.faceAnnotations[i]); + } + } + if (object.landmarkAnnotations) { + if (!Array.isArray(object.landmarkAnnotations)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.landmarkAnnotations: array expected"); + message.landmarkAnnotations = []; + for (var i = 0; i < object.landmarkAnnotations.length; ++i) { + if (typeof object.landmarkAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.landmarkAnnotations: object expected"); + message.landmarkAnnotations[i] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.fromObject(object.landmarkAnnotations[i]); + } + } + if (object.logoAnnotations) { + if (!Array.isArray(object.logoAnnotations)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.logoAnnotations: array expected"); + message.logoAnnotations = []; + for (var i = 0; i < object.logoAnnotations.length; ++i) { + if (typeof object.logoAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.logoAnnotations: object expected"); + message.logoAnnotations[i] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.fromObject(object.logoAnnotations[i]); + } + } + if (object.labelAnnotations) { + if (!Array.isArray(object.labelAnnotations)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.labelAnnotations: array expected"); + message.labelAnnotations = []; + for (var i = 0; i < object.labelAnnotations.length; ++i) { + if (typeof object.labelAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.labelAnnotations: object expected"); + message.labelAnnotations[i] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.fromObject(object.labelAnnotations[i]); + } + } + if (object.localizedObjectAnnotations) { + if (!Array.isArray(object.localizedObjectAnnotations)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.localizedObjectAnnotations: array expected"); + message.localizedObjectAnnotations = []; + for (var i = 0; i < object.localizedObjectAnnotations.length; ++i) { + if (typeof object.localizedObjectAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.localizedObjectAnnotations: object expected"); + message.localizedObjectAnnotations[i] = $root.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.fromObject(object.localizedObjectAnnotations[i]); + } + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.fullTextAnnotation != null) { + if (typeof object.fullTextAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.fullTextAnnotation: object expected"); + message.fullTextAnnotation = $root.google.cloud.vision.v1p3beta1.TextAnnotation.fromObject(object.fullTextAnnotation); + } + if (object.safeSearchAnnotation != null) { + if (typeof object.safeSearchAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.safeSearchAnnotation: object expected"); + message.safeSearchAnnotation = $root.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.fromObject(object.safeSearchAnnotation); + } + if (object.imagePropertiesAnnotation != null) { + if (typeof object.imagePropertiesAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.imagePropertiesAnnotation: object expected"); + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p3beta1.ImageProperties.fromObject(object.imagePropertiesAnnotation); + } + if (object.cropHintsAnnotation != null) { + if (typeof object.cropHintsAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.cropHintsAnnotation: object expected"); + message.cropHintsAnnotation = $root.google.cloud.vision.v1p3beta1.CropHintsAnnotation.fromObject(object.cropHintsAnnotation); + } + if (object.webDetection != null) { + if (typeof object.webDetection !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.webDetection: object expected"); + message.webDetection = $root.google.cloud.vision.v1p3beta1.WebDetection.fromObject(object.webDetection); + } + if (object.productSearchResults != null) { + if (typeof object.productSearchResults !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.productSearchResults: object expected"); + message.productSearchResults = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.fromObject(object.productSearchResults); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateImageResponse.context: object expected"); + message.context = $root.google.cloud.vision.v1p3beta1.ImageAnnotationContext.fromObject(object.context); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p3beta1.AnnotateImageResponse} message AnnotateImageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.faceAnnotations = []; + object.landmarkAnnotations = []; + object.logoAnnotations = []; + object.labelAnnotations = []; + object.textAnnotations = []; + object.localizedObjectAnnotations = []; + } + if (options.defaults) { + object.safeSearchAnnotation = null; + object.imagePropertiesAnnotation = null; + object.error = null; + object.cropHintsAnnotation = null; + object.fullTextAnnotation = null; + object.webDetection = null; + object.productSearchResults = null; + object.context = null; + } + if (message.faceAnnotations && message.faceAnnotations.length) { + object.faceAnnotations = []; + for (var j = 0; j < message.faceAnnotations.length; ++j) + object.faceAnnotations[j] = $root.google.cloud.vision.v1p3beta1.FaceAnnotation.toObject(message.faceAnnotations[j], options); + } + if (message.landmarkAnnotations && message.landmarkAnnotations.length) { + object.landmarkAnnotations = []; + for (var j = 0; j < message.landmarkAnnotations.length; ++j) + object.landmarkAnnotations[j] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.toObject(message.landmarkAnnotations[j], options); + } + if (message.logoAnnotations && message.logoAnnotations.length) { + object.logoAnnotations = []; + for (var j = 0; j < message.logoAnnotations.length; ++j) + object.logoAnnotations[j] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.toObject(message.logoAnnotations[j], options); + } + if (message.labelAnnotations && message.labelAnnotations.length) { + object.labelAnnotations = []; + for (var j = 0; j < message.labelAnnotations.length; ++j) + object.labelAnnotations[j] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.toObject(message.labelAnnotations[j], options); + } + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.vision.v1p3beta1.EntityAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + object.safeSearchAnnotation = $root.google.cloud.vision.v1p3beta1.SafeSearchAnnotation.toObject(message.safeSearchAnnotation, options); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + object.imagePropertiesAnnotation = $root.google.cloud.vision.v1p3beta1.ImageProperties.toObject(message.imagePropertiesAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + object.cropHintsAnnotation = $root.google.cloud.vision.v1p3beta1.CropHintsAnnotation.toObject(message.cropHintsAnnotation, options); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + object.fullTextAnnotation = $root.google.cloud.vision.v1p3beta1.TextAnnotation.toObject(message.fullTextAnnotation, options); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + object.webDetection = $root.google.cloud.vision.v1p3beta1.WebDetection.toObject(message.webDetection, options); + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) + object.productSearchResults = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.toObject(message.productSearchResults, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.vision.v1p3beta1.ImageAnnotationContext.toObject(message.context, options); + if (message.localizedObjectAnnotations && message.localizedObjectAnnotations.length) { + object.localizedObjectAnnotations = []; + for (var j = 0; j < message.localizedObjectAnnotations.length; ++j) + object.localizedObjectAnnotations[j] = $root.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.toObject(message.localizedObjectAnnotations[j], options); + } + return object; + }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AnnotateImageResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageResponse; + })(); + + v1p3beta1.AnnotateFileResponse = (function() { + + /** + * Properties of an AnnotateFileResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAnnotateFileResponse + * @property {google.cloud.vision.v1p3beta1.IInputConfig|null} [inputConfig] AnnotateFileResponse inputConfig + * @property {Array.|null} [responses] AnnotateFileResponse responses + */ + + /** + * Constructs a new AnnotateFileResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AnnotateFileResponse. + * @implements IAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAnnotateFileResponse=} [properties] Properties to set + */ + function AnnotateFileResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AnnotateFileResponse inputConfig. + * @member {google.cloud.vision.v1p3beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.inputConfig = null; + + /** + * AnnotateFileResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AnnotateFileResponse} AnnotateFileResponse instance + */ + AnnotateFileResponse.create = function create(properties) { + return new AnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p3beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.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.vision.v1p3beta1.AnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1p3beta1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateFileResponse.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.vision.v1p3beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AnnotateFileResponse} AnnotateFileResponse + */ + AnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AnnotateFileResponse(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateFileResponse.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p3beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateFileResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AnnotateFileResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.AnnotateFileResponse} message AnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (options.defaults) + object.inputConfig = null; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p3beta1.InputConfig.toObject(message.inputConfig, options); + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateFileResponse; + })(); + + v1p3beta1.BatchAnnotateImagesRequest = (function() { + + /** + * Properties of a BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IBatchAnnotateImagesRequest + * @property {Array.|null} [requests] BatchAnnotateImagesRequest requests + */ + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a BatchAnnotateImagesRequest. + * @implements IBatchAnnotateImagesRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + */ + function BatchAnnotateImagesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchAnnotateImagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @instance + */ + BatchAnnotateImagesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest instance + */ + BatchAnnotateImagesRequest.create = function create(properties) { + return new BatchAnnotateImagesRequest(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p3beta1.AnnotateImageRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.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.vision.v1p3beta1.BatchAnnotateImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p3beta1.AnnotateImageRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.AnnotateImageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + */ + BatchAnnotateImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p3beta1.AnnotateImageRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest} message BatchAnnotateImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p3beta1.AnnotateImageRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesRequest; + })(); + + v1p3beta1.BatchAnnotateImagesResponse = (function() { + + /** + * Properties of a BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IBatchAnnotateImagesResponse + * @property {Array.|null} [responses] BatchAnnotateImagesResponse responses + */ + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a BatchAnnotateImagesResponse. + * @implements IBatchAnnotateImagesResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + */ + function BatchAnnotateImagesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * BatchAnnotateImagesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @instance + */ + BatchAnnotateImagesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse instance + */ + BatchAnnotateImagesResponse.create = function create(properties) { + return new BatchAnnotateImagesResponse(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.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.vision.v1p3beta1.BatchAnnotateImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + */ + BatchAnnotateImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse} message BatchAnnotateImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p3beta1.AnnotateImageResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesResponse; + })(); + + v1p3beta1.AsyncAnnotateFileRequest = (function() { + + /** + * Properties of an AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAsyncAnnotateFileRequest + * @property {google.cloud.vision.v1p3beta1.IInputConfig|null} [inputConfig] AsyncAnnotateFileRequest inputConfig + * @property {Array.|null} [features] AsyncAnnotateFileRequest features + * @property {google.cloud.vision.v1p3beta1.IImageContext|null} [imageContext] AsyncAnnotateFileRequest imageContext + * @property {google.cloud.vision.v1p3beta1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileRequest outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AsyncAnnotateFileRequest. + * @implements IAsyncAnnotateFileRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest=} [properties] Properties to set + */ + function AsyncAnnotateFileRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AsyncAnnotateFileRequest inputConfig. + * @member {google.cloud.vision.v1p3beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.inputConfig = null; + + /** + * AsyncAnnotateFileRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.features = $util.emptyArray; + + /** + * AsyncAnnotateFileRequest imageContext. + * @member {google.cloud.vision.v1p3beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.imageContext = null; + + /** + * AsyncAnnotateFileRequest outputConfig. + * @member {google.cloud.vision.v1p3beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest instance + */ + AsyncAnnotateFileRequest.create = function create(properties) { + return new AsyncAnnotateFileRequest(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p3beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p3beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p3beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.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.vision.v1p3beta1.AsyncAnnotateFileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1p3beta1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p3beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p3beta1.ImageContext.decode(reader, reader.uint32()); + break; + case 4: + message.outputConfig = $root.google.cloud.vision.v1p3beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileRequest.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.vision.v1p3beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p3beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p3beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + */ + AsyncAnnotateFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p3beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p3beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p3beta1.ImageContext.fromObject(object.imageContext); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p3beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest} message AsyncAnnotateFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputConfig = null; + object.imageContext = null; + object.outputConfig = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p3beta1.InputConfig.toObject(message.inputConfig, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p3beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p3beta1.ImageContext.toObject(message.imageContext, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p3beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileRequest; + })(); + + v1p3beta1.AsyncAnnotateFileResponse = (function() { + + /** + * Properties of an AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAsyncAnnotateFileResponse + * @property {google.cloud.vision.v1p3beta1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileResponse outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AsyncAnnotateFileResponse. + * @implements IAsyncAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse=} [properties] Properties to set + */ + function AsyncAnnotateFileResponse(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]]; + } + + /** + * AsyncAnnotateFileResponse outputConfig. + * @member {google.cloud.vision.v1p3beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @instance + */ + AsyncAnnotateFileResponse.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse instance + */ + AsyncAnnotateFileResponse.create = function create(properties) { + return new AsyncAnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p3beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.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.vision.v1p3beta1.AsyncAnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.vision.v1p3beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p3beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + */ + AsyncAnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p3beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse} message AsyncAnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p3beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileResponse; + })(); + + v1p3beta1.AsyncBatchAnnotateFilesRequest = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAsyncBatchAnnotateFilesRequest + * @property {Array.|null} [requests] AsyncBatchAnnotateFilesRequest requests + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AsyncBatchAnnotateFilesRequest. + * @implements IAsyncBatchAnnotateFilesRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @instance + */ + AsyncBatchAnnotateFilesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest instance + */ + AsyncBatchAnnotateFilesRequest.create = function create(properties) { + return new AsyncBatchAnnotateFilesRequest(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.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.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + */ + AsyncBatchAnnotateFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesRequest; + })(); + + v1p3beta1.AsyncBatchAnnotateFilesResponse = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAsyncBatchAnnotateFilesResponse + * @property {Array.|null} [responses] AsyncBatchAnnotateFilesResponse responses + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AsyncBatchAnnotateFilesResponse. + * @implements IAsyncBatchAnnotateFilesResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @instance + */ + AsyncBatchAnnotateFilesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse instance + */ + AsyncBatchAnnotateFilesResponse.create = function create(properties) { + return new AsyncBatchAnnotateFilesResponse(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.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.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + */ + AsyncBatchAnnotateFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesResponse; + })(); + + v1p3beta1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IInputConfig + * @property {google.cloud.vision.v1p3beta1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {string|null} [mimeType] InputConfig mimeType + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.vision.v1p3beta1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(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]]; + } + + /** + * InputConfig gcsSource. + * @member {google.cloud.vision.v1p3beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.vision.v1p3beta1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.vision.v1p3beta1.InputConfig + * @instance + */ + InputConfig.prototype.mimeType = ""; + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.v1p3beta1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.vision.v1p3beta1.GcsSource.decode(reader, reader.uint32()); + break; + case 2: + message.mimeType = 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.vision.v1p3beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.vision.v1p3beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: 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.vision.v1p3beta1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.InputConfig) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.vision.v1p3beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.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.defaults) { + object.gcsSource = null; + object.mimeType = ""; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.vision.v1p3beta1.GcsSource.toObject(message.gcsSource, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputConfig; + })(); + + v1p3beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IOutputConfig + * @property {google.cloud.vision.v1p3beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {number|null} [batchSize] OutputConfig batchSize + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig batchSize. + * @member {number} batchSize + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.batchSize = 0; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.v1p3beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.batchSize); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.vision.v1p3beta1.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.batchSize = reader.int32(); + 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.vision.v1p3beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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"; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + var error = $root.google.cloud.vision.v1p3beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + if (!$util.isInteger(message.batchSize)) + return "batchSize: integer expected"; + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.OutputConfig) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.vision.v1p3beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.batchSize != null) + message.batchSize = object.batchSize | 0; + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.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 (options.defaults) { + object.gcsDestination = null; + object.batchSize = 0; + } + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + object.gcsDestination = $root.google.cloud.vision.v1p3beta1.GcsDestination.toObject(message.gcsDestination, options); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + object.batchSize = message.batchSize; + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1p3beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IGcsSource + * @property {string|null} [uri] GcsSource uri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.vision.v1p3beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(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]]; + } + + /** + * GcsSource uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p3beta1.GcsSource + * @instance + */ + GcsSource.prototype.uri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1p3beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1p3beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.GcsSource) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.GcsSource(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.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.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v1p3beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.vision.v1p3beta1.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 uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p3beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p3beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p3beta1.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1p3beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1p3beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.GcsDestination) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p3beta1.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.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + /** + * Likelihood enum. + * @name google.cloud.vision.v1p3beta1.Likelihood + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1p3beta1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + v1p3beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IOperationMetadata + * @property {google.cloud.vision.v1p3beta1.OperationMetadata.State|null} [state] OperationMetadata state + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.vision.v1p3beta1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata state. + * @member {google.cloud.vision.v1p3beta1.OperationMetadata.State} state + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.state = 0; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p3beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + 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.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.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"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.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; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.OperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATED": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vision.v1p3beta1.OperationMetadata.State[message.state] : message.state; + 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); + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.vision.v1p3beta1.OperationMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATED=1 CREATED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + * @property {number} CANCELLED=4 CANCELLED value + */ + OperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return OperationMetadata; + })(); + + v1p3beta1.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.vision.v1p3beta1.IVertex=} [properties] Properties to set + */ + function Vertex(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]]; + } + + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {google.cloud.vision.v1p3beta1.IVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {google.cloud.vision.v1p3beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && message.hasOwnProperty("x")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); + if (message.y != null && message.hasOwnProperty("y")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); + return writer; + }; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {google.cloud.vision.v1p3beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.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.vision.v1p3beta1.Vertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.int32(); + break; + case 2: + message.y = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vertex message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Vertex) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Vertex(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @static + * @param {google.cloud.vision.v1p3beta1.Vertex} message Vertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vertex.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 = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + + /** + * Converts this Vertex to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Vertex + * @instance + * @returns {Object.} JSON object + */ + Vertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vertex; + })(); + + v1p3beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.vision.v1p3beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.vision.v1p3beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p3beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.v1p3beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vision.v1p3beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NormalizedVertex; + })(); + + v1p3beta1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.vision.v1p3beta1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.vertices = []; + 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 vertices. + * @member {Array.} vertices + * @memberof google.cloud.vision.v1p3beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.vision.v1p3beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p3beta1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.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.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.vision.v1p3beta1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.vision.v1p3beta1.Vertex.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.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.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + 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.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.BoundingPoly) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.vision.v1p3beta1.BoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.vision.v1p3beta1.Vertex.fromObject(object.vertices[i]); + } + } + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.vision.v1p3beta1.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.vision.v1p3beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.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.vertices = []; + object.normalizedVertices = []; + } + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.vision.v1p3beta1.Vertex.toObject(message.vertices[j], options); + } + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.vision.v1p3beta1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoundingPoly; + })(); + + v1p3beta1.NormalizedBoundingPoly = (function() { + + /** + * Properties of a NormalizedBoundingPoly. + * @memberof google.cloud.vision.v1p3beta1 + * @interface INormalizedBoundingPoly + * @property {Array.|null} [vertices] NormalizedBoundingPoly vertices + */ + + /** + * Constructs a new NormalizedBoundingPoly. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a NormalizedBoundingPoly. + * @implements INormalizedBoundingPoly + * @constructor + * @param {google.cloud.vision.v1p3beta1.INormalizedBoundingPoly=} [properties] Properties to set + */ + function NormalizedBoundingPoly(properties) { + this.vertices = []; + 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]]; + } + + /** + * NormalizedBoundingPoly vertices. + * @member {Array.} vertices + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @instance + */ + NormalizedBoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.INormalizedBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly instance + */ + NormalizedBoundingPoly.create = function create(properties) { + return new NormalizedBoundingPoly(properties); + }; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.vision.v1p3beta1.NormalizedVertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.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.vision.v1p3beta1.NormalizedBoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.vision.v1p3beta1.NormalizedVertex.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingPoly message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.NormalizedVertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + */ + NormalizedBoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.vision.v1p3beta1.NormalizedVertex.fromObject(object.vertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.vision.v1p3beta1.NormalizedBoundingPoly} message NormalizedBoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingPoly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vertices = []; + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.vision.v1p3beta1.NormalizedVertex.toObject(message.vertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.NormalizedBoundingPoly + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NormalizedBoundingPoly; + })(); + + v1p3beta1.Position = (function() { + + /** + * Properties of a Position. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IPosition + * @property {number|null} [x] Position x + * @property {number|null} [y] Position y + * @property {number|null} [z] Position z + */ + + /** + * Constructs a new Position. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Position. + * @implements IPosition + * @constructor + * @param {google.cloud.vision.v1p3beta1.IPosition=} [properties] Properties to set + */ + function Position(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]]; + } + + /** + * Position x. + * @member {number} x + * @memberof google.cloud.vision.v1p3beta1.Position + * @instance + */ + Position.prototype.x = 0; + + /** + * Position y. + * @member {number} y + * @memberof google.cloud.vision.v1p3beta1.Position + * @instance + */ + Position.prototype.y = 0; + + /** + * Position z. + * @member {number} z + * @memberof google.cloud.vision.v1p3beta1.Position + * @instance + */ + Position.prototype.z = 0; + + /** + * Creates a new Position instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {google.cloud.vision.v1p3beta1.IPosition=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Position} Position instance + */ + Position.create = function create(properties) { + return new Position(properties); + }; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Position.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {google.cloud.vision.v1p3beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.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); + if (message.z != null && message.hasOwnProperty("z")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.z); + return writer; + }; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Position.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {google.cloud.vision.v1p3beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Position message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.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.vision.v1p3beta1.Position(); + 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; + case 3: + message.z = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Position message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Position.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"; + if (message.z != null && message.hasOwnProperty("z")) + if (typeof message.z !== "number") + return "z: number expected"; + return null; + }; + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Position} Position + */ + Position.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Position) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Position(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + if (object.z != null) + message.z = Number(object.z); + return message; + }; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Position + * @static + * @param {google.cloud.vision.v1p3beta1.Position} message Position + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Position.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + object.z = 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; + if (message.z != null && message.hasOwnProperty("z")) + object.z = options.json && !isFinite(message.z) ? String(message.z) : message.z; + return object; + }; + + /** + * Converts this Position to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Position + * @instance + * @returns {Object.} JSON object + */ + Position.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Position; + })(); + + v1p3beta1.ProductSearchParams = (function() { + + /** + * Properties of a ProductSearchParams. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IProductSearchParams + * @property {string|null} [catalogName] ProductSearchParams catalogName + * @property {google.cloud.vision.v1p3beta1.ProductSearchCategory|null} [category] ProductSearchParams category + * @property {string|null} [productCategory] ProductSearchParams productCategory + * @property {google.cloud.vision.v1p3beta1.INormalizedBoundingPoly|null} [normalizedBoundingPoly] ProductSearchParams normalizedBoundingPoly + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingPoly] ProductSearchParams boundingPoly + * @property {google.cloud.vision.v1p3beta1.ProductSearchResultsView|null} [view] ProductSearchParams view + * @property {string|null} [productSet] ProductSearchParams productSet + * @property {Array.|null} [productCategories] ProductSearchParams productCategories + * @property {string|null} [filter] ProductSearchParams filter + */ + + /** + * Constructs a new ProductSearchParams. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ProductSearchParams. + * @implements IProductSearchParams + * @constructor + * @param {google.cloud.vision.v1p3beta1.IProductSearchParams=} [properties] Properties to set + */ + function ProductSearchParams(properties) { + this.productCategories = []; + 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]]; + } + + /** + * ProductSearchParams catalogName. + * @member {string} catalogName + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.catalogName = ""; + + /** + * ProductSearchParams category. + * @member {google.cloud.vision.v1p3beta1.ProductSearchCategory} category + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.category = 0; + + /** + * ProductSearchParams productCategory. + * @member {string} productCategory + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.productCategory = ""; + + /** + * ProductSearchParams normalizedBoundingPoly. + * @member {google.cloud.vision.v1p3beta1.INormalizedBoundingPoly|null|undefined} normalizedBoundingPoly + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.normalizedBoundingPoly = null; + + /** + * ProductSearchParams boundingPoly. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.boundingPoly = null; + + /** + * ProductSearchParams view. + * @member {google.cloud.vision.v1p3beta1.ProductSearchResultsView} view + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.view = 0; + + /** + * ProductSearchParams productSet. + * @member {string} productSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.productSet = ""; + + /** + * ProductSearchParams productCategories. + * @member {Array.} productCategories + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.productCategories = $util.emptyArray; + + /** + * ProductSearchParams filter. + * @member {string} filter + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.filter = ""; + + /** + * Creates a new ProductSearchParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSearchParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ProductSearchParams} ProductSearchParams instance + */ + ProductSearchParams.create = function create(properties) { + return new ProductSearchParams(properties); + }; + + /** + * Encodes the specified ProductSearchParams message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSearchParams} message ProductSearchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalogName != null && message.hasOwnProperty("catalogName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalogName); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.category); + if (message.normalizedBoundingPoly != null && message.hasOwnProperty("normalizedBoundingPoly")) + $root.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.encode(message.normalizedBoundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.productCategory); + if (message.productSet != null && message.hasOwnProperty("productSet")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.productSet); + if (message.productCategories != null && message.productCategories.length) + for (var i = 0; i < message.productCategories.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.productCategories[i]); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSearchParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSearchParams} message ProductSearchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ProductSearchParams} ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchParams.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.vision.v1p3beta1.ProductSearchParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.catalogName = reader.string(); + break; + case 2: + message.category = reader.int32(); + break; + case 5: + message.productCategory = reader.string(); + break; + case 3: + message.normalizedBoundingPoly = $root.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.decode(reader, reader.uint32()); + break; + case 9: + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 4: + message.view = reader.int32(); + break; + case 6: + message.productSet = reader.string(); + break; + case 7: + if (!(message.productCategories && message.productCategories.length)) + message.productCategories = []; + message.productCategories.push(reader.string()); + break; + case 8: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ProductSearchParams} ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSearchParams message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSearchParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalogName != null && message.hasOwnProperty("catalogName")) + if (!$util.isString(message.catalogName)) + return "catalogName: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + if (!$util.isString(message.productCategory)) + return "productCategory: string expected"; + if (message.normalizedBoundingPoly != null && message.hasOwnProperty("normalizedBoundingPoly")) { + var error = $root.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.verify(message.normalizedBoundingPoly); + if (error) + return "normalizedBoundingPoly." + error; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + break; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + if (!$util.isString(message.productSet)) + return "productSet: string expected"; + if (message.productCategories != null && message.hasOwnProperty("productCategories")) { + if (!Array.isArray(message.productCategories)) + return "productCategories: array expected"; + for (var i = 0; i < message.productCategories.length; ++i) + if (!$util.isString(message.productCategories[i])) + return "productCategories: string[] expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ProductSearchParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ProductSearchParams} ProductSearchParams + */ + ProductSearchParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ProductSearchParams) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ProductSearchParams(); + if (object.catalogName != null) + message.catalogName = String(object.catalogName); + switch (object.category) { + case "PRODUCT_SEARCH_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "SHOES": + case 1: + message.category = 1; + break; + case "BAGS": + case 2: + message.category = 2; + break; + } + if (object.productCategory != null) + message.productCategory = String(object.productCategory); + if (object.normalizedBoundingPoly != null) { + if (typeof object.normalizedBoundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchParams.normalizedBoundingPoly: object expected"); + message.normalizedBoundingPoly = $root.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.fromObject(object.normalizedBoundingPoly); + } + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchParams.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingPoly); + } + switch (object.view) { + case "BASIC": + case 0: + message.view = 0; + break; + case "FULL": + case 1: + message.view = 1; + break; + } + if (object.productSet != null) + message.productSet = String(object.productSet); + if (object.productCategories) { + if (!Array.isArray(object.productCategories)) + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchParams.productCategories: array expected"); + message.productCategories = []; + for (var i = 0; i < object.productCategories.length; ++i) + message.productCategories[i] = String(object.productCategories[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ProductSearchParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchParams} message ProductSearchParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSearchParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productCategories = []; + if (options.defaults) { + object.catalogName = ""; + object.category = options.enums === String ? "PRODUCT_SEARCH_CATEGORY_UNSPECIFIED" : 0; + object.normalizedBoundingPoly = null; + object.view = options.enums === String ? "BASIC" : 0; + object.productCategory = ""; + object.productSet = ""; + object.filter = ""; + object.boundingPoly = null; + } + if (message.catalogName != null && message.hasOwnProperty("catalogName")) + object.catalogName = message.catalogName; + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.vision.v1p3beta1.ProductSearchCategory[message.category] : message.category; + if (message.normalizedBoundingPoly != null && message.hasOwnProperty("normalizedBoundingPoly")) + object.normalizedBoundingPoly = $root.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.toObject(message.normalizedBoundingPoly, options); + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.vision.v1p3beta1.ProductSearchResultsView[message.view] : message.view; + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + object.productCategory = message.productCategory; + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = message.productSet; + if (message.productCategories && message.productCategories.length) { + object.productCategories = []; + for (var j = 0; j < message.productCategories.length; ++j) + object.productCategories[j] = message.productCategories[j]; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingPoly, options); + return object; + }; + + /** + * Converts this ProductSearchParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ProductSearchParams + * @instance + * @returns {Object.} JSON object + */ + ProductSearchParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSearchParams; + })(); + + v1p3beta1.ProductSearchResults = (function() { + + /** + * Properties of a ProductSearchResults. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IProductSearchResults + * @property {google.cloud.vision.v1p3beta1.ProductSearchCategory|null} [category] ProductSearchResults category + * @property {string|null} [productCategory] ProductSearchResults productCategory + * @property {google.protobuf.ITimestamp|null} [indexTime] ProductSearchResults indexTime + * @property {Array.|null} [products] ProductSearchResults products + * @property {Array.|null} [results] ProductSearchResults results + */ + + /** + * Constructs a new ProductSearchResults. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ProductSearchResults. + * @implements IProductSearchResults + * @constructor + * @param {google.cloud.vision.v1p3beta1.IProductSearchResults=} [properties] Properties to set + */ + function ProductSearchResults(properties) { + this.products = []; + this.results = []; + 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]]; + } + + /** + * ProductSearchResults category. + * @member {google.cloud.vision.v1p3beta1.ProductSearchCategory} category + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.category = 0; + + /** + * ProductSearchResults productCategory. + * @member {string} productCategory + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.productCategory = ""; + + /** + * ProductSearchResults indexTime. + * @member {google.protobuf.ITimestamp|null|undefined} indexTime + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.indexTime = null; + + /** + * ProductSearchResults products. + * @member {Array.} products + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.products = $util.emptyArray; + + /** + * ProductSearchResults results. + * @member {Array.} results + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.results = $util.emptyArray; + + /** + * Creates a new ProductSearchResults instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSearchResults=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults} ProductSearchResults instance + */ + ProductSearchResults.create = function create(properties) { + return new ProductSearchResults(properties); + }; + + /** + * Encodes the specified ProductSearchResults message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSearchResults} message ProductSearchResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && message.hasOwnProperty("category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.indexTime != null && message.hasOwnProperty("indexTime")) + $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.encode(message.products[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.productCategory); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.encode(message.results[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSearchResults message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSearchResults} message ProductSearchResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults} ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchResults.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.vision.v1p3beta1.ProductSearchResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.category = reader.int32(); + break; + case 4: + message.productCategory = reader.string(); + break; + case 2: + message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults} ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSearchResults message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSearchResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + if (!$util.isString(message.productCategory)) + return "productCategory: string expected"; + if (message.indexTime != null && message.hasOwnProperty("indexTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (error) + return "indexTime." + error; + } + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.verify(message.results[i]); + if (error) + return "results." + error; + } + } + return null; + }; + + /** + * Creates a ProductSearchResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults} ProductSearchResults + */ + ProductSearchResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ProductSearchResults) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ProductSearchResults(); + switch (object.category) { + case "PRODUCT_SEARCH_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "SHOES": + case 1: + message.category = 1; + break; + case "BAGS": + case 2: + message.category = 2; + break; + } + if (object.productCategory != null) + message.productCategory = String(object.productCategory); + if (object.indexTime != null) { + if (typeof object.indexTime !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchResults.indexTime: object expected"); + message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + } + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchResults.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchResults.products: object expected"); + message.products[i] = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.fromObject(object.products[i]); + } + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchResults.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchResults.results: object expected"); + message.results[i] = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.fromObject(object.results[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProductSearchResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults} message ProductSearchResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSearchResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.products = []; + object.results = []; + } + if (options.defaults) { + object.category = options.enums === String ? "PRODUCT_SEARCH_CATEGORY_UNSPECIFIED" : 0; + object.indexTime = null; + object.productCategory = ""; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.vision.v1p3beta1.ProductSearchCategory[message.category] : message.category; + if (message.indexTime != null && message.hasOwnProperty("indexTime")) + object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.toObject(message.products[j], options); + } + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + object.productCategory = message.productCategory; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.vision.v1p3beta1.ProductSearchResults.Result.toObject(message.results[j], options); + } + return object; + }; + + /** + * Converts this ProductSearchResults to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @instance + * @returns {Object.} JSON object + */ + ProductSearchResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ProductSearchResults.ProductInfo = (function() { + + /** + * Properties of a ProductInfo. + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @interface IProductInfo + * @property {string|null} [productId] ProductInfo productId + * @property {string|null} [imageUri] ProductInfo imageUri + * @property {number|null} [score] ProductInfo score + */ + + /** + * Constructs a new ProductInfo. + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @classdesc Represents a ProductInfo. + * @implements IProductInfo + * @constructor + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo=} [properties] Properties to set + */ + function ProductInfo(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]]; + } + + /** + * ProductInfo productId. + * @member {string} productId + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @instance + */ + ProductInfo.prototype.productId = ""; + + /** + * ProductInfo imageUri. + * @member {string} imageUri + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @instance + */ + ProductInfo.prototype.imageUri = ""; + + /** + * ProductInfo score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @instance + */ + ProductInfo.prototype.score = 0; + + /** + * Creates a new ProductInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo} ProductInfo instance + */ + ProductInfo.create = function create(properties) { + return new ProductInfo(properties); + }; + + /** + * Encodes the specified ProductInfo message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo} message ProductInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productId != null && message.hasOwnProperty("productId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.productId); + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageUri); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + return writer; + }; + + /** + * Encodes the specified ProductInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IProductInfo} message ProductInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo} ProductInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductInfo.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.vision.v1p3beta1.ProductSearchResults.ProductInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productId = reader.string(); + break; + case 2: + message.imageUri = reader.string(); + break; + case 3: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo} ProductInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductInfo message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a ProductInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo} ProductInfo + */ + ProductInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo(); + if (object.productId != null) + message.productId = String(object.productId); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a ProductInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo} message ProductInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.productId = ""; + object.imageUri = ""; + object.score = 0; + } + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ProductInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo + * @instance + * @returns {Object.} JSON object + */ + ProductInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductInfo; + })(); + + ProductSearchResults.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @interface IResult + * @property {google.cloud.vision.v1p3beta1.IProduct|null} [product] Result product + * @property {number|null} [score] Result score + * @property {string|null} [image] Result image + */ + + /** + * Constructs a new Result. + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IResult=} [properties] Properties to set + */ + function Result(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]]; + } + + /** + * Result product. + * @member {google.cloud.vision.v1p3beta1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @instance + */ + Result.prototype.product = null; + + /** + * Result score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @instance + */ + Result.prototype.score = 0; + + /** + * Result image. + * @member {string} image + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @instance + */ + Result.prototype.image = ""; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IResult=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.Result.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1p3beta1.Product.encode(message.product, 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); + if (message.image != null && message.hasOwnProperty("image")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.image); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSearchResults.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.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.vision.v1p3beta1.ProductSearchResults.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.vision.v1p3beta1.Product.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.image = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1p3beta1.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ProductSearchResults.Result} Result + */ + Result.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ProductSearchResults.Result) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ProductSearchResults.Result(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSearchResults.Result.product: object expected"); + message.product = $root.google.cloud.vision.v1p3beta1.Product.fromObject(object.product); + } + if (object.score != null) + message.score = Number(object.score); + if (object.image != null) + message.image = String(object.image); + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSearchResults.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.score = 0; + object.image = ""; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1p3beta1.Product.toObject(message.product, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ProductSearchResults.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Result; + })(); + + return ProductSearchResults; + })(); + + /** + * ProductSearchCategory enum. + * @name google.cloud.vision.v1p3beta1.ProductSearchCategory + * @enum {string} + * @property {number} PRODUCT_SEARCH_CATEGORY_UNSPECIFIED=0 PRODUCT_SEARCH_CATEGORY_UNSPECIFIED value + * @property {number} SHOES=1 SHOES value + * @property {number} BAGS=2 BAGS value + */ + v1p3beta1.ProductSearchCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRODUCT_SEARCH_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOES"] = 1; + values[valuesById[2] = "BAGS"] = 2; + return values; + })(); + + /** + * ProductSearchResultsView enum. + * @name google.cloud.vision.v1p3beta1.ProductSearchResultsView + * @enum {string} + * @property {number} BASIC=0 BASIC value + * @property {number} FULL=1 FULL value + */ + v1p3beta1.ProductSearchResultsView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BASIC"] = 0; + values[valuesById[1] = "FULL"] = 1; + return values; + })(); + + v1p3beta1.ProductSearch = (function() { + + /** + * Constructs a new ProductSearch service. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ProductSearch + * @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 ProductSearch(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ProductSearch.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductSearch; + + /** + * Creates new ProductSearch service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @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 {ProductSearch} RPC service. Useful where requests and/or responses are streamed. + */ + ProductSearch.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#createProductSet}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef CreateProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ProductSet} [response] ProductSet + */ + + /** + * Calls CreateProductSet. + * @function createProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.ICreateProductSetRequest} request CreateProductSetRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.CreateProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createProductSet = function createProductSet(request, callback) { + return this.rpcCall(createProductSet, $root.google.cloud.vision.v1p3beta1.CreateProductSetRequest, $root.google.cloud.vision.v1p3beta1.ProductSet, request, callback); + }, "name", { value: "CreateProductSet" }); + + /** + * Calls CreateProductSet. + * @function createProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.ICreateProductSetRequest} request CreateProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listProductSets}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef ListProductSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ListProductSetsResponse} [response] ListProductSetsResponse + */ + + /** + * Calls ListProductSets. + * @function listProductSets + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListProductSetsRequest} request ListProductSetsRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.ListProductSetsCallback} callback Node-style callback called with the error, if any, and ListProductSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProductSets = function listProductSets(request, callback) { + return this.rpcCall(listProductSets, $root.google.cloud.vision.v1p3beta1.ListProductSetsRequest, $root.google.cloud.vision.v1p3beta1.ListProductSetsResponse, request, callback); + }, "name", { value: "ListProductSets" }); + + /** + * Calls ListProductSets. + * @function listProductSets + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListProductSetsRequest} request ListProductSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#getProductSet}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef GetProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ProductSet} [response] ProductSet + */ + + /** + * Calls GetProductSet. + * @function getProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IGetProductSetRequest} request GetProductSetRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.GetProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getProductSet = function getProductSet(request, callback) { + return this.rpcCall(getProductSet, $root.google.cloud.vision.v1p3beta1.GetProductSetRequest, $root.google.cloud.vision.v1p3beta1.ProductSet, request, callback); + }, "name", { value: "GetProductSet" }); + + /** + * Calls GetProductSet. + * @function getProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IGetProductSetRequest} request GetProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#updateProductSet}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef UpdateProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ProductSet} [response] ProductSet + */ + + /** + * Calls UpdateProductSet. + * @function updateProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IUpdateProductSetRequest} request UpdateProductSetRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.UpdateProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.updateProductSet = function updateProductSet(request, callback) { + return this.rpcCall(updateProductSet, $root.google.cloud.vision.v1p3beta1.UpdateProductSetRequest, $root.google.cloud.vision.v1p3beta1.ProductSet, request, callback); + }, "name", { value: "UpdateProductSet" }); + + /** + * Calls UpdateProductSet. + * @function updateProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IUpdateProductSetRequest} request UpdateProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#deleteProductSet}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef DeleteProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteProductSet. + * @function deleteProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IDeleteProductSetRequest} request DeleteProductSetRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.DeleteProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteProductSet = function deleteProductSet(request, callback) { + return this.rpcCall(deleteProductSet, $root.google.cloud.vision.v1p3beta1.DeleteProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProductSet" }); + + /** + * Calls DeleteProductSet. + * @function deleteProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IDeleteProductSetRequest} request DeleteProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#createProduct}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef CreateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.Product} [response] Product + */ + + /** + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.ICreateProductRequest} request CreateProductRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.CreateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createProduct = function createProduct(request, callback) { + return this.rpcCall(createProduct, $root.google.cloud.vision.v1p3beta1.CreateProductRequest, $root.google.cloud.vision.v1p3beta1.Product, request, callback); + }, "name", { value: "CreateProduct" }); + + /** + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.ICreateProductRequest} request CreateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listProducts}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef ListProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ListProductsResponse} [response] ListProductsResponse + */ + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListProductsRequest} request ListProductsRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProducts = function listProducts(request, callback) { + return this.rpcCall(listProducts, $root.google.cloud.vision.v1p3beta1.ListProductsRequest, $root.google.cloud.vision.v1p3beta1.ListProductsResponse, request, callback); + }, "name", { value: "ListProducts" }); + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListProductsRequest} request ListProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#getProduct}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef GetProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.Product} [response] Product + */ + + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IGetProductRequest} request GetProductRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.GetProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getProduct = function getProduct(request, callback) { + return this.rpcCall(getProduct, $root.google.cloud.vision.v1p3beta1.GetProductRequest, $root.google.cloud.vision.v1p3beta1.Product, request, callback); + }, "name", { value: "GetProduct" }); + + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IGetProductRequest} request GetProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#updateProduct}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef UpdateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.Product} [response] Product + */ + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.updateProduct = function updateProduct(request, callback) { + return this.rpcCall(updateProduct, $root.google.cloud.vision.v1p3beta1.UpdateProductRequest, $root.google.cloud.vision.v1p3beta1.Product, request, callback); + }, "name", { value: "UpdateProduct" }); + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#deleteProduct}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef DeleteProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteProduct = function deleteProduct(request, callback) { + return this.rpcCall(deleteProduct, $root.google.cloud.vision.v1p3beta1.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProduct" }); + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#createReferenceImage}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef CreateReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ReferenceImage} [response] ReferenceImage + */ + + /** + * Calls CreateReferenceImage. + * @function createReferenceImage + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest} request CreateReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.CreateReferenceImageCallback} callback Node-style callback called with the error, if any, and ReferenceImage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createReferenceImage = function createReferenceImage(request, callback) { + return this.rpcCall(createReferenceImage, $root.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest, $root.google.cloud.vision.v1p3beta1.ReferenceImage, request, callback); + }, "name", { value: "CreateReferenceImage" }); + + /** + * Calls CreateReferenceImage. + * @function createReferenceImage + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest} request CreateReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#deleteReferenceImage}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef DeleteReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteReferenceImage. + * @function deleteReferenceImage + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest} request DeleteReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.DeleteReferenceImageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteReferenceImage = function deleteReferenceImage(request, callback) { + return this.rpcCall(deleteReferenceImage, $root.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteReferenceImage" }); + + /** + * Calls DeleteReferenceImage. + * @function deleteReferenceImage + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest} request DeleteReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listReferenceImages}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef ListReferenceImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} [response] ListReferenceImagesResponse + */ + + /** + * Calls ListReferenceImages. + * @function listReferenceImages + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesRequest} request ListReferenceImagesRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.ListReferenceImagesCallback} callback Node-style callback called with the error, if any, and ListReferenceImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listReferenceImages = function listReferenceImages(request, callback) { + return this.rpcCall(listReferenceImages, $root.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest, $root.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse, request, callback); + }, "name", { value: "ListReferenceImages" }); + + /** + * Calls ListReferenceImages. + * @function listReferenceImages + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesRequest} request ListReferenceImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#getReferenceImage}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef GetReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ReferenceImage} [response] ReferenceImage + */ + + /** + * Calls GetReferenceImage. + * @function getReferenceImage + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IGetReferenceImageRequest} request GetReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.GetReferenceImageCallback} callback Node-style callback called with the error, if any, and ReferenceImage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getReferenceImage = function getReferenceImage(request, callback) { + return this.rpcCall(getReferenceImage, $root.google.cloud.vision.v1p3beta1.GetReferenceImageRequest, $root.google.cloud.vision.v1p3beta1.ReferenceImage, request, callback); + }, "name", { value: "GetReferenceImage" }); + + /** + * Calls GetReferenceImage. + * @function getReferenceImage + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IGetReferenceImageRequest} request GetReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#addProductToProductSet}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef AddProductToProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls AddProductToProductSet. + * @function addProductToProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest} request AddProductToProductSetRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.AddProductToProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.addProductToProductSet = function addProductToProductSet(request, callback) { + return this.rpcCall(addProductToProductSet, $root.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "AddProductToProductSet" }); + + /** + * Calls AddProductToProductSet. + * @function addProductToProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest} request AddProductToProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#removeProductFromProductSet}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef RemoveProductFromProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls RemoveProductFromProductSet. + * @function removeProductFromProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest} request RemoveProductFromProductSetRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.RemoveProductFromProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.removeProductFromProductSet = function removeProductFromProductSet(request, callback) { + return this.rpcCall(removeProductFromProductSet, $root.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "RemoveProductFromProductSet" }); + + /** + * Calls RemoveProductFromProductSet. + * @function removeProductFromProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest} request RemoveProductFromProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#listProductsInProductSet}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef ListProductsInProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} [response] ListProductsInProductSetResponse + */ + + /** + * Calls ListProductsInProductSet. + * @function listProductsInProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest} request ListProductsInProductSetRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.ListProductsInProductSetCallback} callback Node-style callback called with the error, if any, and ListProductsInProductSetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProductsInProductSet = function listProductsInProductSet(request, callback) { + return this.rpcCall(listProductsInProductSet, $root.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest, $root.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse, request, callback); + }, "name", { value: "ListProductsInProductSet" }); + + /** + * Calls ListProductsInProductSet. + * @function listProductsInProductSet + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest} request ListProductsInProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p3beta1.ProductSearch#importProductSets}. + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @typedef ImportProductSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportProductSets. + * @function importProductSets + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsRequest} request ImportProductSetsRequest message or plain object + * @param {google.cloud.vision.v1p3beta1.ProductSearch.ImportProductSetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.importProductSets = function importProductSets(request, callback) { + return this.rpcCall(importProductSets, $root.google.cloud.vision.v1p3beta1.ImportProductSetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportProductSets" }); + + /** + * Calls ImportProductSets. + * @function importProductSets + * @memberof google.cloud.vision.v1p3beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsRequest} request ImportProductSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProductSearch; + })(); + + v1p3beta1.Product = (function() { + + /** + * Properties of a Product. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IProduct + * @property {string|null} [name] Product name + * @property {string|null} [displayName] Product displayName + * @property {string|null} [description] Product description + * @property {string|null} [productCategory] Product productCategory + * @property {Array.|null} [productLabels] Product productLabels + */ + + /** + * Constructs a new Product. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Product. + * @implements IProduct + * @constructor + * @param {google.cloud.vision.v1p3beta1.IProduct=} [properties] Properties to set + */ + function Product(properties) { + this.productLabels = []; + 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]]; + } + + /** + * Product name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.Product + * @instance + */ + Product.prototype.name = ""; + + /** + * Product displayName. + * @member {string} displayName + * @memberof google.cloud.vision.v1p3beta1.Product + * @instance + */ + Product.prototype.displayName = ""; + + /** + * Product description. + * @member {string} description + * @memberof google.cloud.vision.v1p3beta1.Product + * @instance + */ + Product.prototype.description = ""; + + /** + * Product productCategory. + * @member {string} productCategory + * @memberof google.cloud.vision.v1p3beta1.Product + * @instance + */ + Product.prototype.productCategory = ""; + + /** + * Product productLabels. + * @member {Array.} productLabels + * @memberof google.cloud.vision.v1p3beta1.Product + * @instance + */ + Product.prototype.productLabels = $util.emptyArray; + + /** + * Creates a new Product instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {google.cloud.vision.v1p3beta1.IProduct=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Product} Product instance + */ + Product.create = function create(properties) { + return new Product(properties); + }; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {google.cloud.vision.v1p3beta1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.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.productCategory != null && message.hasOwnProperty("productCategory")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.productCategory); + if (message.productLabels != null && message.productLabels.length) + for (var i = 0; i < message.productLabels.length; ++i) + $root.google.cloud.vision.v1p3beta1.Product.KeyValue.encode(message.productLabels[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {google.cloud.vision.v1p3beta1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Product message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.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.vision.v1p3beta1.Product(); + 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 3: + message.description = reader.string(); + break; + case 4: + message.productCategory = reader.string(); + break; + case 5: + if (!(message.productLabels && message.productLabels.length)) + message.productLabels = []; + message.productLabels.push($root.google.cloud.vision.v1p3beta1.Product.KeyValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Product message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Product.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + if (!$util.isString(message.productCategory)) + return "productCategory: string expected"; + if (message.productLabels != null && message.hasOwnProperty("productLabels")) { + if (!Array.isArray(message.productLabels)) + return "productLabels: array expected"; + for (var i = 0; i < message.productLabels.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Product.KeyValue.verify(message.productLabels[i]); + if (error) + return "productLabels." + error; + } + } + return null; + }; + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Product} Product + */ + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Product) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Product(); + 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.productCategory != null) + message.productCategory = String(object.productCategory); + if (object.productLabels) { + if (!Array.isArray(object.productLabels)) + throw TypeError(".google.cloud.vision.v1p3beta1.Product.productLabels: array expected"); + message.productLabels = []; + for (var i = 0; i < object.productLabels.length; ++i) { + if (typeof object.productLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Product.productLabels: object expected"); + message.productLabels[i] = $root.google.cloud.vision.v1p3beta1.Product.KeyValue.fromObject(object.productLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Product + * @static + * @param {google.cloud.vision.v1p3beta1.Product} message Product + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Product.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productLabels = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.productCategory = ""; + } + 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.productCategory != null && message.hasOwnProperty("productCategory")) + object.productCategory = message.productCategory; + if (message.productLabels && message.productLabels.length) { + object.productLabels = []; + for (var j = 0; j < message.productLabels.length; ++j) + object.productLabels[j] = $root.google.cloud.vision.v1p3beta1.Product.KeyValue.toObject(message.productLabels[j], options); + } + return object; + }; + + /** + * Converts this Product to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Product + * @instance + * @returns {Object.} JSON object + */ + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Product.KeyValue = (function() { + + /** + * Properties of a KeyValue. + * @memberof google.cloud.vision.v1p3beta1.Product + * @interface IKeyValue + * @property {string|null} [key] KeyValue key + * @property {string|null} [value] KeyValue value + */ + + /** + * Constructs a new KeyValue. + * @memberof google.cloud.vision.v1p3beta1.Product + * @classdesc Represents a KeyValue. + * @implements IKeyValue + * @constructor + * @param {google.cloud.vision.v1p3beta1.Product.IKeyValue=} [properties] Properties to set + */ + function KeyValue(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]]; + } + + /** + * KeyValue key. + * @member {string} key + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @instance + */ + KeyValue.prototype.key = ""; + + /** + * KeyValue value. + * @member {string} value + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @instance + */ + KeyValue.prototype.value = ""; + + /** + * Creates a new KeyValue instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p3beta1.Product.IKeyValue=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Product.KeyValue} KeyValue instance + */ + KeyValue.create = function create(properties) { + return new KeyValue(properties); + }; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.KeyValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p3beta1.Product.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && message.hasOwnProperty("key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Product.KeyValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p3beta1.Product.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Product.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.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.vision.v1p3beta1.Product.KeyValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Product.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyValue message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Product.KeyValue} KeyValue + */ + KeyValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Product.KeyValue) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Product.KeyValue(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p3beta1.Product.KeyValue} message KeyValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this KeyValue to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Product.KeyValue + * @instance + * @returns {Object.} JSON object + */ + KeyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KeyValue; + })(); + + return Product; + })(); + + v1p3beta1.ProductSet = (function() { + + /** + * Properties of a ProductSet. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IProductSet + * @property {string|null} [name] ProductSet name + * @property {string|null} [displayName] ProductSet displayName + * @property {google.protobuf.ITimestamp|null} [indexTime] ProductSet indexTime + * @property {google.rpc.IStatus|null} [indexError] ProductSet indexError + */ + + /** + * Constructs a new ProductSet. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ProductSet. + * @implements IProductSet + * @constructor + * @param {google.cloud.vision.v1p3beta1.IProductSet=} [properties] Properties to set + */ + function ProductSet(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]]; + } + + /** + * ProductSet name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @instance + */ + ProductSet.prototype.name = ""; + + /** + * ProductSet displayName. + * @member {string} displayName + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @instance + */ + ProductSet.prototype.displayName = ""; + + /** + * ProductSet indexTime. + * @member {google.protobuf.ITimestamp|null|undefined} indexTime + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @instance + */ + ProductSet.prototype.indexTime = null; + + /** + * ProductSet indexError. + * @member {google.rpc.IStatus|null|undefined} indexError + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @instance + */ + ProductSet.prototype.indexError = null; + + /** + * Creates a new ProductSet instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSet=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ProductSet} ProductSet instance + */ + ProductSet.create = function create(properties) { + return new ProductSet(properties); + }; + + /** + * Encodes the specified ProductSet message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSet} message ProductSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSet.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.indexTime != null && message.hasOwnProperty("indexTime")) + $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.indexError != null && message.hasOwnProperty("indexError")) + $root.google.rpc.Status.encode(message.indexError, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSet message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ProductSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p3beta1.IProductSet} message ProductSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ProductSet} ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSet.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.vision.v1p3beta1.ProductSet(); + 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 3: + message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.indexError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ProductSet} ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSet message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSet.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.indexTime != null && message.hasOwnProperty("indexTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (error) + return "indexTime." + error; + } + if (message.indexError != null && message.hasOwnProperty("indexError")) { + var error = $root.google.rpc.Status.verify(message.indexError); + if (error) + return "indexError." + error; + } + return null; + }; + + /** + * Creates a ProductSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ProductSet} ProductSet + */ + ProductSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ProductSet) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ProductSet(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.indexTime != null) { + if (typeof object.indexTime !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSet.indexTime: object expected"); + message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + } + if (object.indexError != null) { + if (typeof object.indexError !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ProductSet.indexError: object expected"); + message.indexError = $root.google.rpc.Status.fromObject(object.indexError); + } + return message; + }; + + /** + * Creates a plain object from a ProductSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p3beta1.ProductSet} message ProductSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.indexTime = null; + object.indexError = 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.indexTime != null && message.hasOwnProperty("indexTime")) + object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + if (message.indexError != null && message.hasOwnProperty("indexError")) + object.indexError = $root.google.rpc.Status.toObject(message.indexError, options); + return object; + }; + + /** + * Converts this ProductSet to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ProductSet + * @instance + * @returns {Object.} JSON object + */ + ProductSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSet; + })(); + + v1p3beta1.ReferenceImage = (function() { + + /** + * Properties of a ReferenceImage. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IReferenceImage + * @property {string|null} [name] ReferenceImage name + * @property {string|null} [uri] ReferenceImage uri + * @property {Array.|null} [boundingPolys] ReferenceImage boundingPolys + */ + + /** + * Constructs a new ReferenceImage. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ReferenceImage. + * @implements IReferenceImage + * @constructor + * @param {google.cloud.vision.v1p3beta1.IReferenceImage=} [properties] Properties to set + */ + function ReferenceImage(properties) { + this.boundingPolys = []; + 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]]; + } + + /** + * ReferenceImage name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.name = ""; + + /** + * ReferenceImage uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.uri = ""; + + /** + * ReferenceImage boundingPolys. + * @member {Array.} boundingPolys + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.boundingPolys = $util.emptyArray; + + /** + * Creates a new ReferenceImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p3beta1.IReferenceImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ReferenceImage} ReferenceImage instance + */ + ReferenceImage.create = function create(properties) { + return new ReferenceImage(properties); + }; + + /** + * Encodes the specified ReferenceImage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ReferenceImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p3beta1.IReferenceImage} message ReferenceImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferenceImage.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.boundingPolys != null && message.boundingPolys.length) + for (var i = 0; i < message.boundingPolys.length; ++i) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingPolys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReferenceImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ReferenceImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p3beta1.IReferenceImage} message ReferenceImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferenceImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ReferenceImage} ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferenceImage.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.vision.v1p3beta1.ReferenceImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + case 3: + if (!(message.boundingPolys && message.boundingPolys.length)) + message.boundingPolys = []; + message.boundingPolys.push($root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ReferenceImage} ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferenceImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReferenceImage message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReferenceImage.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.boundingPolys != null && message.hasOwnProperty("boundingPolys")) { + if (!Array.isArray(message.boundingPolys)) + return "boundingPolys: array expected"; + for (var i = 0; i < message.boundingPolys.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingPolys[i]); + if (error) + return "boundingPolys." + error; + } + } + return null; + }; + + /** + * Creates a ReferenceImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ReferenceImage} ReferenceImage + */ + ReferenceImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ReferenceImage) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ReferenceImage(); + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.boundingPolys) { + if (!Array.isArray(object.boundingPolys)) + throw TypeError(".google.cloud.vision.v1p3beta1.ReferenceImage.boundingPolys: array expected"); + message.boundingPolys = []; + for (var i = 0; i < object.boundingPolys.length; ++i) { + if (typeof object.boundingPolys[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ReferenceImage.boundingPolys: object expected"); + message.boundingPolys[i] = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingPolys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReferenceImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p3beta1.ReferenceImage} message ReferenceImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReferenceImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingPolys = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.boundingPolys && message.boundingPolys.length) { + object.boundingPolys = []; + for (var j = 0; j < message.boundingPolys.length; ++j) + object.boundingPolys[j] = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingPolys[j], options); + } + return object; + }; + + /** + * Converts this ReferenceImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ReferenceImage + * @instance + * @returns {Object.} JSON object + */ + ReferenceImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReferenceImage; + })(); + + v1p3beta1.CreateProductRequest = (function() { + + /** + * Properties of a CreateProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ICreateProductRequest + * @property {string|null} [parent] CreateProductRequest parent + * @property {google.cloud.vision.v1p3beta1.IProduct|null} [product] CreateProductRequest product + * @property {string|null} [productId] CreateProductRequest productId + */ + + /** + * Constructs a new CreateProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a CreateProductRequest. + * @implements ICreateProductRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.ICreateProductRequest=} [properties] Properties to set + */ + function CreateProductRequest(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]]; + } + + /** + * CreateProductRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.parent = ""; + + /** + * CreateProductRequest product. + * @member {google.cloud.vision.v1p3beta1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.product = null; + + /** + * CreateProductRequest productId. + * @member {string} productId + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.productId = ""; + + /** + * Creates a new CreateProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.CreateProductRequest} CreateProductRequest instance + */ + CreateProductRequest.create = function create(properties) { + return new CreateProductRequest(properties); + }; + + /** + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductRequest.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.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1p3beta1.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productId != null && message.hasOwnProperty("productId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); + return writer; + }; + + /** + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.CreateProductRequest} CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductRequest.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.vision.v1p3beta1.CreateProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.product = $root.google.cloud.vision.v1p3beta1.Product.decode(reader, reader.uint32()); + break; + case 3: + message.productId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.CreateProductRequest} CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProductRequest.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.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1p3beta1.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + return null; + }; + + /** + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.CreateProductRequest} CreateProductRequest + */ + CreateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.CreateProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.CreateProductRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.CreateProductRequest.product: object expected"); + message.product = $root.google.cloud.vision.v1p3beta1.Product.fromObject(object.product); + } + if (object.productId != null) + message.productId = String(object.productId); + return message; + }; + + /** + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.CreateProductRequest} message CreateProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.product = null; + object.productId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1p3beta1.Product.toObject(message.product, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + return object; + }; + + /** + * Converts this CreateProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.CreateProductRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateProductRequest; + })(); + + v1p3beta1.ListProductsRequest = (function() { + + /** + * Properties of a ListProductsRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListProductsRequest + * @property {string|null} [parent] ListProductsRequest parent + * @property {number|null} [pageSize] ListProductsRequest pageSize + * @property {string|null} [pageToken] ListProductsRequest pageToken + */ + + /** + * Constructs a new ListProductsRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListProductsRequest. + * @implements IListProductsRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListProductsRequest=} [properties] Properties to set + */ + function ListProductsRequest(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]]; + } + + /** + * ListProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.parent = ""; + + /** + * ListProductsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageSize = 0; + + /** + * ListProductsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListProductsRequest} ListProductsRequest instance + */ + ListProductsRequest.create = function create(properties) { + return new ListProductsRequest(properties); + }; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.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.vision.v1p3beta1.ListProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsRequest.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.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 ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListProductsRequest} ListProductsRequest + */ + ListProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListProductsRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ListProductsRequest} message ListProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListProductsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsRequest; + })(); + + v1p3beta1.ListProductsResponse = (function() { + + /** + * Properties of a ListProductsResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListProductsResponse + * @property {Array.|null} [products] ListProductsResponse products + * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken + */ + + /** + * Constructs a new ListProductsResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListProductsResponse. + * @implements IListProductsResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListProductsResponse=} [properties] Properties to set + */ + function ListProductsResponse(properties) { + this.products = []; + 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]]; + } + + /** + * ListProductsResponse products. + * @member {Array.} products + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.products = $util.emptyArray; + + /** + * ListProductsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListProductsResponse} ListProductsResponse instance + */ + ListProductsResponse.create = function create(properties) { + return new ListProductsResponse(properties); + }; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.vision.v1p3beta1.Product.encode(message.products[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 ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.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.vision.v1p3beta1.ListProductsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.vision.v1p3beta1.Product.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListProductsResponse} ListProductsResponse + */ + ListProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListProductsResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListProductsResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.vision.v1p3beta1.ListProductsResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ListProductsResponse.products: object expected"); + message.products[i] = $root.google.cloud.vision.v1p3beta1.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.ListProductsResponse} message ListProductsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.vision.v1p3beta1.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListProductsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsResponse; + })(); + + v1p3beta1.GetProductRequest = (function() { + + /** + * Properties of a GetProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IGetProductRequest + * @property {string|null} [name] GetProductRequest name + */ + + /** + * Constructs a new GetProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a GetProductRequest. + * @implements IGetProductRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IGetProductRequest=} [properties] Properties to set + */ + function GetProductRequest(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]]; + } + + /** + * GetProductRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @instance + */ + GetProductRequest.prototype.name = ""; + + /** + * Creates a new GetProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.GetProductRequest} GetProductRequest instance + */ + GetProductRequest.create = function create(properties) { + return new GetProductRequest(properties); + }; + + /** + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductRequest.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 GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductRequest.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.vision.v1p3beta1.GetProductRequest(); + 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 GetProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProductRequest.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 GetProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.GetProductRequest} GetProductRequest + */ + GetProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.GetProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.GetProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.GetProductRequest} message GetProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProductRequest.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 GetProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.GetProductRequest + * @instance + * @returns {Object.} JSON object + */ + GetProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProductRequest; + })(); + + v1p3beta1.UpdateProductRequest = (function() { + + /** + * Properties of an UpdateProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IUpdateProductRequest + * @property {google.cloud.vision.v1p3beta1.IProduct|null} [product] UpdateProductRequest product + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask + */ + + /** + * Constructs a new UpdateProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an UpdateProductRequest. + * @implements IUpdateProductRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IUpdateProductRequest=} [properties] Properties to set + */ + function UpdateProductRequest(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]]; + } + + /** + * UpdateProductRequest product. + * @member {google.cloud.vision.v1p3beta1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @instance + */ + UpdateProductRequest.prototype.product = null; + + /** + * UpdateProductRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @instance + */ + UpdateProductRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IUpdateProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.UpdateProductRequest} UpdateProductRequest instance + */ + UpdateProductRequest.create = function create(properties) { + return new UpdateProductRequest(properties); + }; + + /** + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1p3beta1.Product.encode(message.product, 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 UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductRequest.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.vision.v1p3beta1.UpdateProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.vision.v1p3beta1.Product.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProductRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1p3beta1.Product.verify(message.product); + if (error) + return "product." + 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.UpdateProductRequest} UpdateProductRequest + */ + UpdateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.UpdateProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.UpdateProductRequest(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.UpdateProductRequest.product: object expected"); + message.product = $root.google.cloud.vision.v1p3beta1.Product.fromObject(object.product); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.UpdateProductRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.UpdateProductRequest} message UpdateProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.updateMask = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1p3beta1.Product.toObject(message.product, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.UpdateProductRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateProductRequest; + })(); + + v1p3beta1.DeleteProductRequest = (function() { + + /** + * Properties of a DeleteProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IDeleteProductRequest + * @property {string|null} [name] DeleteProductRequest name + */ + + /** + * Constructs a new DeleteProductRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a DeleteProductRequest. + * @implements IDeleteProductRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IDeleteProductRequest=} [properties] Properties to set + */ + function DeleteProductRequest(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]]; + } + + /** + * DeleteProductRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @instance + */ + DeleteProductRequest.prototype.name = ""; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.DeleteProductRequest} DeleteProductRequest instance + */ + DeleteProductRequest.create = function create(properties) { + return new DeleteProductRequest(properties); + }; + + /** + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductRequest.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 DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.DeleteProductRequest} DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductRequest.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.vision.v1p3beta1.DeleteProductRequest(); + 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 DeleteProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.DeleteProductRequest} DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProductRequest.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 DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.DeleteProductRequest} DeleteProductRequest + */ + DeleteProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.DeleteProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.DeleteProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p3beta1.DeleteProductRequest} message DeleteProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProductRequest.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 DeleteProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.DeleteProductRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteProductRequest; + })(); + + v1p3beta1.CreateProductSetRequest = (function() { + + /** + * Properties of a CreateProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ICreateProductSetRequest + * @property {string|null} [parent] CreateProductSetRequest parent + * @property {google.cloud.vision.v1p3beta1.IProductSet|null} [productSet] CreateProductSetRequest productSet + * @property {string|null} [productSetId] CreateProductSetRequest productSetId + */ + + /** + * Constructs a new CreateProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a CreateProductSetRequest. + * @implements ICreateProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.ICreateProductSetRequest=} [properties] Properties to set + */ + function CreateProductSetRequest(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]]; + } + + /** + * CreateProductSetRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.parent = ""; + + /** + * CreateProductSetRequest productSet. + * @member {google.cloud.vision.v1p3beta1.IProductSet|null|undefined} productSet + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.productSet = null; + + /** + * CreateProductSetRequest productSetId. + * @member {string} productSetId + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.productSetId = ""; + + /** + * Creates a new CreateProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.CreateProductSetRequest} CreateProductSetRequest instance + */ + CreateProductSetRequest.create = function create(properties) { + return new CreateProductSetRequest(properties); + }; + + /** + * Encodes the specified CreateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateProductSetRequest} message CreateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductSetRequest.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.productSet != null && message.hasOwnProperty("productSet")) + $root.google.cloud.vision.v1p3beta1.ProductSet.encode(message.productSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productSetId); + return writer; + }; + + /** + * Encodes the specified CreateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateProductSetRequest} message CreateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.CreateProductSetRequest} CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductSetRequest.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.vision.v1p3beta1.CreateProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.productSet = $root.google.cloud.vision.v1p3beta1.ProductSet.decode(reader, reader.uint32()); + break; + case 3: + message.productSetId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.CreateProductSetRequest} CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProductSetRequest.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.productSet != null && message.hasOwnProperty("productSet")) { + var error = $root.google.cloud.vision.v1p3beta1.ProductSet.verify(message.productSet); + if (error) + return "productSet." + error; + } + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + if (!$util.isString(message.productSetId)) + return "productSetId: string expected"; + return null; + }; + + /** + * Creates a CreateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.CreateProductSetRequest} CreateProductSetRequest + */ + CreateProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.CreateProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.CreateProductSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.productSet != null) { + if (typeof object.productSet !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.CreateProductSetRequest.productSet: object expected"); + message.productSet = $root.google.cloud.vision.v1p3beta1.ProductSet.fromObject(object.productSet); + } + if (object.productSetId != null) + message.productSetId = String(object.productSetId); + return message; + }; + + /** + * Creates a plain object from a CreateProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.CreateProductSetRequest} message CreateProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.productSet = null; + object.productSetId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = $root.google.cloud.vision.v1p3beta1.ProductSet.toObject(message.productSet, options); + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + object.productSetId = message.productSetId; + return object; + }; + + /** + * Converts this CreateProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.CreateProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateProductSetRequest; + })(); + + v1p3beta1.ListProductSetsRequest = (function() { + + /** + * Properties of a ListProductSetsRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListProductSetsRequest + * @property {string|null} [parent] ListProductSetsRequest parent + * @property {number|null} [pageSize] ListProductSetsRequest pageSize + * @property {string|null} [pageToken] ListProductSetsRequest pageToken + */ + + /** + * Constructs a new ListProductSetsRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListProductSetsRequest. + * @implements IListProductSetsRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListProductSetsRequest=} [properties] Properties to set + */ + function ListProductSetsRequest(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]]; + } + + /** + * ListProductSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.parent = ""; + + /** + * ListProductSetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.pageSize = 0; + + /** + * ListProductSetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductSetsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsRequest} ListProductSetsRequest instance + */ + ListProductSetsRequest.create = function create(properties) { + return new ListProductSetsRequest(properties); + }; + + /** + * Encodes the specified ListProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductSetsRequest} message ListProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductSetsRequest} message ListProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsRequest} ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsRequest.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.vision.v1p3beta1.ListProductSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsRequest} ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductSetsRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductSetsRequest.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.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 ListProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsRequest} ListProductSetsRequest + */ + ListProductSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListProductSetsRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListProductSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ListProductSetsRequest} message ListProductSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProductSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductSetsRequest; + })(); + + v1p3beta1.ListProductSetsResponse = (function() { + + /** + * Properties of a ListProductSetsResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListProductSetsResponse + * @property {Array.|null} [productSets] ListProductSetsResponse productSets + * @property {string|null} [nextPageToken] ListProductSetsResponse nextPageToken + */ + + /** + * Constructs a new ListProductSetsResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListProductSetsResponse. + * @implements IListProductSetsResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListProductSetsResponse=} [properties] Properties to set + */ + function ListProductSetsResponse(properties) { + this.productSets = []; + 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]]; + } + + /** + * ListProductSetsResponse productSets. + * @member {Array.} productSets + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @instance + */ + ListProductSetsResponse.prototype.productSets = $util.emptyArray; + + /** + * ListProductSetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @instance + */ + ListProductSetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductSetsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsResponse} ListProductSetsResponse instance + */ + ListProductSetsResponse.create = function create(properties) { + return new ListProductSetsResponse(properties); + }; + + /** + * Encodes the specified ListProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductSetsResponse} message ListProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSets != null && message.productSets.length) + for (var i = 0; i < message.productSets.length; ++i) + $root.google.cloud.vision.v1p3beta1.ProductSet.encode(message.productSets[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 ListProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductSetsResponse} message ListProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsResponse} ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsResponse.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.vision.v1p3beta1.ListProductSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.productSets && message.productSets.length)) + message.productSets = []; + message.productSets.push($root.google.cloud.vision.v1p3beta1.ProductSet.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsResponse} ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductSetsResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productSets != null && message.hasOwnProperty("productSets")) { + if (!Array.isArray(message.productSets)) + return "productSets: array expected"; + for (var i = 0; i < message.productSets.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.ProductSet.verify(message.productSets[i]); + if (error) + return "productSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListProductSetsResponse} ListProductSetsResponse + */ + ListProductSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListProductSetsResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListProductSetsResponse(); + if (object.productSets) { + if (!Array.isArray(object.productSets)) + throw TypeError(".google.cloud.vision.v1p3beta1.ListProductSetsResponse.productSets: array expected"); + message.productSets = []; + for (var i = 0; i < object.productSets.length; ++i) { + if (typeof object.productSets[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ListProductSetsResponse.productSets: object expected"); + message.productSets[i] = $root.google.cloud.vision.v1p3beta1.ProductSet.fromObject(object.productSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.ListProductSetsResponse} message ListProductSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.productSets && message.productSets.length) { + object.productSets = []; + for (var j = 0; j < message.productSets.length; ++j) + object.productSets[j] = $root.google.cloud.vision.v1p3beta1.ProductSet.toObject(message.productSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListProductSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductSetsResponse; + })(); + + v1p3beta1.GetProductSetRequest = (function() { + + /** + * Properties of a GetProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IGetProductSetRequest + * @property {string|null} [name] GetProductSetRequest name + */ + + /** + * Constructs a new GetProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a GetProductSetRequest. + * @implements IGetProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IGetProductSetRequest=} [properties] Properties to set + */ + function GetProductSetRequest(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]]; + } + + /** + * GetProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @instance + */ + GetProductSetRequest.prototype.name = ""; + + /** + * Creates a new GetProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.GetProductSetRequest} GetProductSetRequest instance + */ + GetProductSetRequest.create = function create(properties) { + return new GetProductSetRequest(properties); + }; + + /** + * Encodes the specified GetProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetProductSetRequest} message GetProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductSetRequest.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 GetProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetProductSetRequest} message GetProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.GetProductSetRequest} GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductSetRequest.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.vision.v1p3beta1.GetProductSetRequest(); + 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 GetProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.GetProductSetRequest} GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProductSetRequest.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 GetProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.GetProductSetRequest} GetProductSetRequest + */ + GetProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.GetProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.GetProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.GetProductSetRequest} message GetProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProductSetRequest.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 GetProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.GetProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProductSetRequest; + })(); + + v1p3beta1.UpdateProductSetRequest = (function() { + + /** + * Properties of an UpdateProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IUpdateProductSetRequest + * @property {google.cloud.vision.v1p3beta1.IProductSet|null} [productSet] UpdateProductSetRequest productSet + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductSetRequest updateMask + */ + + /** + * Constructs a new UpdateProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an UpdateProductSetRequest. + * @implements IUpdateProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IUpdateProductSetRequest=} [properties] Properties to set + */ + function UpdateProductSetRequest(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]]; + } + + /** + * UpdateProductSetRequest productSet. + * @member {google.cloud.vision.v1p3beta1.IProductSet|null|undefined} productSet + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @instance + */ + UpdateProductSetRequest.prototype.productSet = null; + + /** + * UpdateProductSetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @instance + */ + UpdateProductSetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IUpdateProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.UpdateProductSetRequest} UpdateProductSetRequest instance + */ + UpdateProductSetRequest.create = function create(properties) { + return new UpdateProductSetRequest(properties); + }; + + /** + * Encodes the specified UpdateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IUpdateProductSetRequest} message UpdateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSet != null && message.hasOwnProperty("productSet")) + $root.google.cloud.vision.v1p3beta1.ProductSet.encode(message.productSet, 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 UpdateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.UpdateProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IUpdateProductSetRequest} message UpdateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.UpdateProductSetRequest} UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductSetRequest.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.vision.v1p3beta1.UpdateProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productSet = $root.google.cloud.vision.v1p3beta1.ProductSet.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.UpdateProductSetRequest} UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProductSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productSet != null && message.hasOwnProperty("productSet")) { + var error = $root.google.cloud.vision.v1p3beta1.ProductSet.verify(message.productSet); + if (error) + return "productSet." + 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 UpdateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.UpdateProductSetRequest} UpdateProductSetRequest + */ + UpdateProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.UpdateProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.UpdateProductSetRequest(); + if (object.productSet != null) { + if (typeof object.productSet !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.UpdateProductSetRequest.productSet: object expected"); + message.productSet = $root.google.cloud.vision.v1p3beta1.ProductSet.fromObject(object.productSet); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.UpdateProductSetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.UpdateProductSetRequest} message UpdateProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.productSet = null; + object.updateMask = null; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = $root.google.cloud.vision.v1p3beta1.ProductSet.toObject(message.productSet, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.UpdateProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateProductSetRequest; + })(); + + v1p3beta1.DeleteProductSetRequest = (function() { + + /** + * Properties of a DeleteProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IDeleteProductSetRequest + * @property {string|null} [name] DeleteProductSetRequest name + */ + + /** + * Constructs a new DeleteProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a DeleteProductSetRequest. + * @implements IDeleteProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IDeleteProductSetRequest=} [properties] Properties to set + */ + function DeleteProductSetRequest(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]]; + } + + /** + * DeleteProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @instance + */ + DeleteProductSetRequest.prototype.name = ""; + + /** + * Creates a new DeleteProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.DeleteProductSetRequest} DeleteProductSetRequest instance + */ + DeleteProductSetRequest.create = function create(properties) { + return new DeleteProductSetRequest(properties); + }; + + /** + * Encodes the specified DeleteProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteProductSetRequest} message DeleteProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductSetRequest.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 DeleteProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteProductSetRequest} message DeleteProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.DeleteProductSetRequest} DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductSetRequest.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.vision.v1p3beta1.DeleteProductSetRequest(); + 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 DeleteProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.DeleteProductSetRequest} DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProductSetRequest.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 DeleteProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.DeleteProductSetRequest} DeleteProductSetRequest + */ + DeleteProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.DeleteProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.DeleteProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.DeleteProductSetRequest} message DeleteProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProductSetRequest.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 DeleteProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.DeleteProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteProductSetRequest; + })(); + + v1p3beta1.CreateReferenceImageRequest = (function() { + + /** + * Properties of a CreateReferenceImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ICreateReferenceImageRequest + * @property {string|null} [parent] CreateReferenceImageRequest parent + * @property {google.cloud.vision.v1p3beta1.IReferenceImage|null} [referenceImage] CreateReferenceImageRequest referenceImage + * @property {string|null} [referenceImageId] CreateReferenceImageRequest referenceImageId + */ + + /** + * Constructs a new CreateReferenceImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a CreateReferenceImageRequest. + * @implements ICreateReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest=} [properties] Properties to set + */ + function CreateReferenceImageRequest(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]]; + } + + /** + * CreateReferenceImageRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.parent = ""; + + /** + * CreateReferenceImageRequest referenceImage. + * @member {google.cloud.vision.v1p3beta1.IReferenceImage|null|undefined} referenceImage + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.referenceImage = null; + + /** + * CreateReferenceImageRequest referenceImageId. + * @member {string} referenceImageId + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.referenceImageId = ""; + + /** + * Creates a new CreateReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.CreateReferenceImageRequest} CreateReferenceImageRequest instance + */ + CreateReferenceImageRequest.create = function create(properties) { + return new CreateReferenceImageRequest(properties); + }; + + /** + * Encodes the specified CreateReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest} message CreateReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReferenceImageRequest.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.referenceImage != null && message.hasOwnProperty("referenceImage")) + $root.google.cloud.vision.v1p3beta1.ReferenceImage.encode(message.referenceImage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.referenceImageId); + return writer; + }; + + /** + * Encodes the specified CreateReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ICreateReferenceImageRequest} message CreateReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.CreateReferenceImageRequest} CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReferenceImageRequest.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.vision.v1p3beta1.CreateReferenceImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.referenceImage = $root.google.cloud.vision.v1p3beta1.ReferenceImage.decode(reader, reader.uint32()); + break; + case 3: + message.referenceImageId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.CreateReferenceImageRequest} CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReferenceImageRequest.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.referenceImage != null && message.hasOwnProperty("referenceImage")) { + var error = $root.google.cloud.vision.v1p3beta1.ReferenceImage.verify(message.referenceImage); + if (error) + return "referenceImage." + error; + } + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + if (!$util.isString(message.referenceImageId)) + return "referenceImageId: string expected"; + return null; + }; + + /** + * Creates a CreateReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.CreateReferenceImageRequest} CreateReferenceImageRequest + */ + CreateReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.referenceImage != null) { + if (typeof object.referenceImage !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.referenceImage: object expected"); + message.referenceImage = $root.google.cloud.vision.v1p3beta1.ReferenceImage.fromObject(object.referenceImage); + } + if (object.referenceImageId != null) + message.referenceImageId = String(object.referenceImageId); + return message; + }; + + /** + * Creates a plain object from a CreateReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.CreateReferenceImageRequest} message CreateReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReferenceImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.referenceImage = null; + object.referenceImageId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.referenceImage != null && message.hasOwnProperty("referenceImage")) + object.referenceImage = $root.google.cloud.vision.v1p3beta1.ReferenceImage.toObject(message.referenceImage, options); + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + object.referenceImageId = message.referenceImageId; + return object; + }; + + /** + * Converts this CreateReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.CreateReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateReferenceImageRequest; + })(); + + v1p3beta1.ListReferenceImagesRequest = (function() { + + /** + * Properties of a ListReferenceImagesRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListReferenceImagesRequest + * @property {string|null} [parent] ListReferenceImagesRequest parent + * @property {number|null} [pageSize] ListReferenceImagesRequest pageSize + * @property {string|null} [pageToken] ListReferenceImagesRequest pageToken + */ + + /** + * Constructs a new ListReferenceImagesRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListReferenceImagesRequest. + * @implements IListReferenceImagesRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesRequest=} [properties] Properties to set + */ + function ListReferenceImagesRequest(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]]; + } + + /** + * ListReferenceImagesRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.parent = ""; + + /** + * ListReferenceImagesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.pageSize = 0; + + /** + * ListReferenceImagesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListReferenceImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesRequest} ListReferenceImagesRequest instance + */ + ListReferenceImagesRequest.create = function create(properties) { + return new ListReferenceImagesRequest(properties); + }; + + /** + * Encodes the specified ListReferenceImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesRequest} message ListReferenceImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListReferenceImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesRequest} message ListReferenceImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesRequest} ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesRequest.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.vision.v1p3beta1.ListReferenceImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesRequest} ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReferenceImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReferenceImagesRequest.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.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 ListReferenceImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesRequest} ListReferenceImagesRequest + */ + ListReferenceImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListReferenceImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ListReferenceImagesRequest} message ListReferenceImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReferenceImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListReferenceImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListReferenceImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReferenceImagesRequest; + })(); + + v1p3beta1.ListReferenceImagesResponse = (function() { + + /** + * Properties of a ListReferenceImagesResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListReferenceImagesResponse + * @property {Array.|null} [referenceImages] ListReferenceImagesResponse referenceImages + * @property {number|null} [pageSize] ListReferenceImagesResponse pageSize + * @property {string|null} [nextPageToken] ListReferenceImagesResponse nextPageToken + */ + + /** + * Constructs a new ListReferenceImagesResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListReferenceImagesResponse. + * @implements IListReferenceImagesResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesResponse=} [properties] Properties to set + */ + function ListReferenceImagesResponse(properties) { + this.referenceImages = []; + 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]]; + } + + /** + * ListReferenceImagesResponse referenceImages. + * @member {Array.} referenceImages + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.referenceImages = $util.emptyArray; + + /** + * ListReferenceImagesResponse pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.pageSize = 0; + + /** + * ListReferenceImagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReferenceImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} ListReferenceImagesResponse instance + */ + ListReferenceImagesResponse.create = function create(properties) { + return new ListReferenceImagesResponse(properties); + }; + + /** + * Encodes the specified ListReferenceImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesResponse} message ListReferenceImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceImages != null && message.referenceImages.length) + for (var i = 0; i < message.referenceImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.ReferenceImage.encode(message.referenceImages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListReferenceImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListReferenceImagesResponse} message ListReferenceImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesResponse.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.vision.v1p3beta1.ListReferenceImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.referenceImages && message.referenceImages.length)) + message.referenceImages = []; + message.referenceImages.push($root.google.cloud.vision.v1p3beta1.ReferenceImage.decode(reader, reader.uint32())); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReferenceImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReferenceImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceImages != null && message.hasOwnProperty("referenceImages")) { + if (!Array.isArray(message.referenceImages)) + return "referenceImages: array expected"; + for (var i = 0; i < message.referenceImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.ReferenceImage.verify(message.referenceImages[i]); + if (error) + return "referenceImages." + error; + } + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReferenceImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} ListReferenceImagesResponse + */ + ListReferenceImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse(); + if (object.referenceImages) { + if (!Array.isArray(object.referenceImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.referenceImages: array expected"); + message.referenceImages = []; + for (var i = 0; i < object.referenceImages.length; ++i) { + if (typeof object.referenceImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.referenceImages: object expected"); + message.referenceImages[i] = $root.google.cloud.vision.v1p3beta1.ReferenceImage.fromObject(object.referenceImages[i]); + } + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReferenceImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p3beta1.ListReferenceImagesResponse} message ListReferenceImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReferenceImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.referenceImages = []; + if (options.defaults) { + object.pageSize = 0; + object.nextPageToken = ""; + } + if (message.referenceImages && message.referenceImages.length) { + object.referenceImages = []; + for (var j = 0; j < message.referenceImages.length; ++j) + object.referenceImages[j] = $root.google.cloud.vision.v1p3beta1.ReferenceImage.toObject(message.referenceImages[j], options); + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReferenceImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListReferenceImagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListReferenceImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReferenceImagesResponse; + })(); + + v1p3beta1.GetReferenceImageRequest = (function() { + + /** + * Properties of a GetReferenceImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IGetReferenceImageRequest + * @property {string|null} [name] GetReferenceImageRequest name + */ + + /** + * Constructs a new GetReferenceImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a GetReferenceImageRequest. + * @implements IGetReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IGetReferenceImageRequest=} [properties] Properties to set + */ + function GetReferenceImageRequest(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]]; + } + + /** + * GetReferenceImageRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @instance + */ + GetReferenceImageRequest.prototype.name = ""; + + /** + * Creates a new GetReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.GetReferenceImageRequest} GetReferenceImageRequest instance + */ + GetReferenceImageRequest.create = function create(properties) { + return new GetReferenceImageRequest(properties); + }; + + /** + * Encodes the specified GetReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetReferenceImageRequest} message GetReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReferenceImageRequest.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 GetReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.GetReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IGetReferenceImageRequest} message GetReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.GetReferenceImageRequest} GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReferenceImageRequest.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.vision.v1p3beta1.GetReferenceImageRequest(); + 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 GetReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.GetReferenceImageRequest} GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReferenceImageRequest.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 GetReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.GetReferenceImageRequest} GetReferenceImageRequest + */ + GetReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.GetReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.GetReferenceImageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.GetReferenceImageRequest} message GetReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReferenceImageRequest.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 GetReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.GetReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + GetReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetReferenceImageRequest; + })(); + + v1p3beta1.DeleteReferenceImageRequest = (function() { + + /** + * Properties of a DeleteReferenceImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IDeleteReferenceImageRequest + * @property {string|null} [name] DeleteReferenceImageRequest name + */ + + /** + * Constructs a new DeleteReferenceImageRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a DeleteReferenceImageRequest. + * @implements IDeleteReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest=} [properties] Properties to set + */ + function DeleteReferenceImageRequest(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]]; + } + + /** + * DeleteReferenceImageRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @instance + */ + DeleteReferenceImageRequest.prototype.name = ""; + + /** + * Creates a new DeleteReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest instance + */ + DeleteReferenceImageRequest.create = function create(properties) { + return new DeleteReferenceImageRequest(properties); + }; + + /** + * Encodes the specified DeleteReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest} message DeleteReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IDeleteReferenceImageRequest} message DeleteReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReferenceImageRequest.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.vision.v1p3beta1.DeleteReferenceImageRequest(); + 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 DeleteReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + */ + DeleteReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest} message DeleteReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteReferenceImageRequest; + })(); + + v1p3beta1.AddProductToProductSetRequest = (function() { + + /** + * Properties of an AddProductToProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IAddProductToProductSetRequest + * @property {string|null} [name] AddProductToProductSetRequest name + * @property {string|null} [product] AddProductToProductSetRequest product + */ + + /** + * Constructs a new AddProductToProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an AddProductToProductSetRequest. + * @implements IAddProductToProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest=} [properties] Properties to set + */ + function AddProductToProductSetRequest(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]]; + } + + /** + * AddProductToProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @instance + */ + AddProductToProductSetRequest.prototype.name = ""; + + /** + * AddProductToProductSetRequest product. + * @member {string} product + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @instance + */ + AddProductToProductSetRequest.prototype.product = ""; + + /** + * Creates a new AddProductToProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.AddProductToProductSetRequest} AddProductToProductSetRequest instance + */ + AddProductToProductSetRequest.create = function create(properties) { + return new AddProductToProductSetRequest(properties); + }; + + /** + * Encodes the specified AddProductToProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest} message AddProductToProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddProductToProductSetRequest.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.product != null && message.hasOwnProperty("product")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.product); + return writer; + }; + + /** + * Encodes the specified AddProductToProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IAddProductToProductSetRequest} message AddProductToProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddProductToProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.AddProductToProductSetRequest} AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddProductToProductSetRequest.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.vision.v1p3beta1.AddProductToProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.product = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.AddProductToProductSetRequest} AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddProductToProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddProductToProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddProductToProductSetRequest.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.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + return null; + }; + + /** + * Creates an AddProductToProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.AddProductToProductSetRequest} AddProductToProductSetRequest + */ + AddProductToProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.product != null) + message.product = String(object.product); + return message; + }; + + /** + * Creates a plain object from an AddProductToProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.AddProductToProductSetRequest} message AddProductToProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddProductToProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.product = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + return object; + }; + + /** + * Converts this AddProductToProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.AddProductToProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + AddProductToProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddProductToProductSetRequest; + })(); + + v1p3beta1.RemoveProductFromProductSetRequest = (function() { + + /** + * Properties of a RemoveProductFromProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IRemoveProductFromProductSetRequest + * @property {string|null} [name] RemoveProductFromProductSetRequest name + * @property {string|null} [product] RemoveProductFromProductSetRequest product + */ + + /** + * Constructs a new RemoveProductFromProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a RemoveProductFromProductSetRequest. + * @implements IRemoveProductFromProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest=} [properties] Properties to set + */ + function RemoveProductFromProductSetRequest(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]]; + } + + /** + * RemoveProductFromProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @instance + */ + RemoveProductFromProductSetRequest.prototype.name = ""; + + /** + * RemoveProductFromProductSetRequest product. + * @member {string} product + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @instance + */ + RemoveProductFromProductSetRequest.prototype.product = ""; + + /** + * Creates a new RemoveProductFromProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest instance + */ + RemoveProductFromProductSetRequest.create = function create(properties) { + return new RemoveProductFromProductSetRequest(properties); + }; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveProductFromProductSetRequest.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.product != null && message.hasOwnProperty("product")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.product); + return writer; + }; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IRemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveProductFromProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveProductFromProductSetRequest.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.vision.v1p3beta1.RemoveProductFromProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.product = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveProductFromProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveProductFromProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveProductFromProductSetRequest.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.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + return null; + }; + + /** + * Creates a RemoveProductFromProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + */ + RemoveProductFromProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.product != null) + message.product = String(object.product); + return message; + }; + + /** + * Creates a plain object from a RemoveProductFromProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveProductFromProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.product = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + return object; + }; + + /** + * Converts this RemoveProductFromProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveProductFromProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveProductFromProductSetRequest; + })(); + + v1p3beta1.ListProductsInProductSetRequest = (function() { + + /** + * Properties of a ListProductsInProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListProductsInProductSetRequest + * @property {string|null} [name] ListProductsInProductSetRequest name + * @property {number|null} [pageSize] ListProductsInProductSetRequest pageSize + * @property {string|null} [pageToken] ListProductsInProductSetRequest pageToken + */ + + /** + * Constructs a new ListProductsInProductSetRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListProductsInProductSetRequest. + * @implements IListProductsInProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest=} [properties] Properties to set + */ + function ListProductsInProductSetRequest(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]]; + } + + /** + * ListProductsInProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.name = ""; + + /** + * ListProductsInProductSetRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.pageSize = 0; + + /** + * ListProductsInProductSetRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductsInProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest instance + */ + ListProductsInProductSetRequest.create = function create(properties) { + return new ListProductsInProductSetRequest(properties); + }; + + /** + * Encodes the specified ListProductsInProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest} message ListProductsInProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductsInProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetRequest} message ListProductsInProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetRequest.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.vision.v1p3beta1.ListProductsInProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsInProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsInProductSetRequest.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.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 ListProductsInProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + */ + ListProductsInProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListProductsInProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest} message ListProductsInProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsInProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 ListProductsInProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductsInProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsInProductSetRequest; + })(); + + v1p3beta1.ListProductsInProductSetResponse = (function() { + + /** + * Properties of a ListProductsInProductSetResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IListProductsInProductSetResponse + * @property {Array.|null} [products] ListProductsInProductSetResponse products + * @property {string|null} [nextPageToken] ListProductsInProductSetResponse nextPageToken + */ + + /** + * Constructs a new ListProductsInProductSetResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a ListProductsInProductSetResponse. + * @implements IListProductsInProductSetResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse=} [properties] Properties to set + */ + function ListProductsInProductSetResponse(properties) { + this.products = []; + 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]]; + } + + /** + * ListProductsInProductSetResponse products. + * @member {Array.} products + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @instance + */ + ListProductsInProductSetResponse.prototype.products = $util.emptyArray; + + /** + * ListProductsInProductSetResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @instance + */ + ListProductsInProductSetResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductsInProductSetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse instance + */ + ListProductsInProductSetResponse.create = function create(properties) { + return new ListProductsInProductSetResponse(properties); + }; + + /** + * Encodes the specified ListProductsInProductSetResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse} message ListProductsInProductSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.vision.v1p3beta1.Product.encode(message.products[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 ListProductsInProductSetResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IListProductsInProductSetResponse} message ListProductsInProductSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetResponse.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.vision.v1p3beta1.ListProductsInProductSetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.vision.v1p3beta1.Product.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsInProductSetResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsInProductSetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductsInProductSetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + */ + ListProductsInProductSetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.products: object expected"); + message.products[i] = $root.google.cloud.vision.v1p3beta1.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsInProductSetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse} message ListProductsInProductSetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsInProductSetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.vision.v1p3beta1.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductsInProductSetResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductsInProductSetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsInProductSetResponse; + })(); + + v1p3beta1.ImportProductSetsGcsSource = (function() { + + /** + * Properties of an ImportProductSetsGcsSource. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImportProductSetsGcsSource + * @property {string|null} [csvFileUri] ImportProductSetsGcsSource csvFileUri + */ + + /** + * Constructs a new ImportProductSetsGcsSource. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImportProductSetsGcsSource. + * @implements IImportProductSetsGcsSource + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource=} [properties] Properties to set + */ + function ImportProductSetsGcsSource(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]]; + } + + /** + * ImportProductSetsGcsSource csvFileUri. + * @member {string} csvFileUri + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @instance + */ + ImportProductSetsGcsSource.prototype.csvFileUri = ""; + + /** + * Creates a new ImportProductSetsGcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource instance + */ + ImportProductSetsGcsSource.create = function create(properties) { + return new ImportProductSetsGcsSource(properties); + }; + + /** + * Encodes the specified ImportProductSetsGcsSource message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource} message ImportProductSetsGcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsGcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.csvFileUri); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsGcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource} message ImportProductSetsGcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsGcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsGcsSource.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.vision.v1p3beta1.ImportProductSetsGcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.csvFileUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsGcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsGcsSource message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsGcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + if (!$util.isString(message.csvFileUri)) + return "csvFileUri: string expected"; + return null; + }; + + /** + * Creates an ImportProductSetsGcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + */ + ImportProductSetsGcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource(); + if (object.csvFileUri != null) + message.csvFileUri = String(object.csvFileUri); + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsGcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource} message ImportProductSetsGcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsGcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.csvFileUri = ""; + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + object.csvFileUri = message.csvFileUri; + return object; + }; + + /** + * Converts this ImportProductSetsGcsSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsGcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsGcsSource; + })(); + + v1p3beta1.ImportProductSetsInputConfig = (function() { + + /** + * Properties of an ImportProductSetsInputConfig. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImportProductSetsInputConfig + * @property {google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource|null} [gcsSource] ImportProductSetsInputConfig gcsSource + */ + + /** + * Constructs a new ImportProductSetsInputConfig. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImportProductSetsInputConfig. + * @implements IImportProductSetsInputConfig + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig=} [properties] Properties to set + */ + function ImportProductSetsInputConfig(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]]; + } + + /** + * ImportProductSetsInputConfig gcsSource. + * @member {google.cloud.vision.v1p3beta1.IImportProductSetsGcsSource|null|undefined} gcsSource + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @instance + */ + ImportProductSetsInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportProductSetsInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @instance + */ + Object.defineProperty(ImportProductSetsInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportProductSetsInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig instance + */ + ImportProductSetsInputConfig.create = function create(properties) { + return new ImportProductSetsInputConfig(properties); + }; + + /** + * Encodes the specified ImportProductSetsInputConfig message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig} message ImportProductSetsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsInputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig} message ImportProductSetsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsInputConfig.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.vision.v1p3beta1.ImportProductSetsInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsInputConfig message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsInputConfig.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.vision.v1p3beta1.ImportProductSetsGcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates an ImportProductSetsInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + */ + ImportProductSetsInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig} message ImportProductSetsInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this ImportProductSetsInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsInputConfig; + })(); + + v1p3beta1.ImportProductSetsRequest = (function() { + + /** + * Properties of an ImportProductSetsRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImportProductSetsRequest + * @property {string|null} [parent] ImportProductSetsRequest parent + * @property {google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig|null} [inputConfig] ImportProductSetsRequest inputConfig + */ + + /** + * Constructs a new ImportProductSetsRequest. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImportProductSetsRequest. + * @implements IImportProductSetsRequest + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsRequest=} [properties] Properties to set + */ + function ImportProductSetsRequest(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]]; + } + + /** + * ImportProductSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @instance + */ + ImportProductSetsRequest.prototype.parent = ""; + + /** + * ImportProductSetsRequest inputConfig. + * @member {google.cloud.vision.v1p3beta1.IImportProductSetsInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @instance + */ + ImportProductSetsRequest.prototype.inputConfig = null; + + /** + * Creates a new ImportProductSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsRequest} ImportProductSetsRequest instance + */ + ImportProductSetsRequest.create = function create(properties) { + return new ImportProductSetsRequest(properties); + }; + + /** + * Encodes the specified ImportProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsRequest} message ImportProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsRequest} message ImportProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsRequest} ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsRequest.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.vision.v1p3beta1.ImportProductSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsRequest} ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsRequest message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + return null; + }; + + /** + * Creates an ImportProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsRequest} ImportProductSetsRequest + */ + ImportProductSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImportProductSetsRequest) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImportProductSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImportProductSetsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.fromObject(object.inputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p3beta1.ImportProductSetsRequest} message ImportProductSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.toObject(message.inputConfig, options); + return object; + }; + + /** + * Converts this ImportProductSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsRequest; + })(); + + v1p3beta1.ImportProductSetsResponse = (function() { + + /** + * Properties of an ImportProductSetsResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IImportProductSetsResponse + * @property {Array.|null} [referenceImages] ImportProductSetsResponse referenceImages + * @property {Array.|null} [statuses] ImportProductSetsResponse statuses + */ + + /** + * Constructs a new ImportProductSetsResponse. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents an ImportProductSetsResponse. + * @implements IImportProductSetsResponse + * @constructor + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsResponse=} [properties] Properties to set + */ + function ImportProductSetsResponse(properties) { + this.referenceImages = []; + this.statuses = []; + 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]]; + } + + /** + * ImportProductSetsResponse referenceImages. + * @member {Array.} referenceImages + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @instance + */ + ImportProductSetsResponse.prototype.referenceImages = $util.emptyArray; + + /** + * ImportProductSetsResponse statuses. + * @member {Array.} statuses + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @instance + */ + ImportProductSetsResponse.prototype.statuses = $util.emptyArray; + + /** + * Creates a new ImportProductSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsResponse} ImportProductSetsResponse instance + */ + ImportProductSetsResponse.create = function create(properties) { + return new ImportProductSetsResponse(properties); + }; + + /** + * Encodes the specified ImportProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsResponse} message ImportProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceImages != null && message.referenceImages.length) + for (var i = 0; i < message.referenceImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.ReferenceImage.encode(message.referenceImages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.statuses != null && message.statuses.length) + for (var i = 0; i < message.statuses.length; ++i) + $root.google.rpc.Status.encode(message.statuses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.ImportProductSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.IImportProductSetsResponse} message ImportProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsResponse} ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsResponse.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.vision.v1p3beta1.ImportProductSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.referenceImages && message.referenceImages.length)) + message.referenceImages = []; + message.referenceImages.push($root.google.cloud.vision.v1p3beta1.ReferenceImage.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.statuses && message.statuses.length)) + message.statuses = []; + message.statuses.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsResponse} ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsResponse message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceImages != null && message.hasOwnProperty("referenceImages")) { + if (!Array.isArray(message.referenceImages)) + return "referenceImages: array expected"; + for (var i = 0; i < message.referenceImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.ReferenceImage.verify(message.referenceImages[i]); + if (error) + return "referenceImages." + error; + } + } + if (message.statuses != null && message.hasOwnProperty("statuses")) { + if (!Array.isArray(message.statuses)) + return "statuses: array expected"; + for (var i = 0; i < message.statuses.length; ++i) { + var error = $root.google.rpc.Status.verify(message.statuses[i]); + if (error) + return "statuses." + error; + } + } + return null; + }; + + /** + * Creates an ImportProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.ImportProductSetsResponse} ImportProductSetsResponse + */ + ImportProductSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.ImportProductSetsResponse) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.ImportProductSetsResponse(); + if (object.referenceImages) { + if (!Array.isArray(object.referenceImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.ImportProductSetsResponse.referenceImages: array expected"); + message.referenceImages = []; + for (var i = 0; i < object.referenceImages.length; ++i) { + if (typeof object.referenceImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImportProductSetsResponse.referenceImages: object expected"); + message.referenceImages[i] = $root.google.cloud.vision.v1p3beta1.ReferenceImage.fromObject(object.referenceImages[i]); + } + } + if (object.statuses) { + if (!Array.isArray(object.statuses)) + throw TypeError(".google.cloud.vision.v1p3beta1.ImportProductSetsResponse.statuses: array expected"); + message.statuses = []; + for (var i = 0; i < object.statuses.length; ++i) { + if (typeof object.statuses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.ImportProductSetsResponse.statuses: object expected"); + message.statuses[i] = $root.google.rpc.Status.fromObject(object.statuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p3beta1.ImportProductSetsResponse} message ImportProductSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.referenceImages = []; + object.statuses = []; + } + if (message.referenceImages && message.referenceImages.length) { + object.referenceImages = []; + for (var j = 0; j < message.referenceImages.length; ++j) + object.referenceImages[j] = $root.google.cloud.vision.v1p3beta1.ReferenceImage.toObject(message.referenceImages[j], options); + } + if (message.statuses && message.statuses.length) { + object.statuses = []; + for (var j = 0; j < message.statuses.length; ++j) + object.statuses[j] = $root.google.rpc.Status.toObject(message.statuses[j], options); + } + return object; + }; + + /** + * Converts this ImportProductSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.ImportProductSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsResponse; + })(); + + v1p3beta1.BatchOperationMetadata = (function() { + + /** + * Properties of a BatchOperationMetadata. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IBatchOperationMetadata + * @property {google.cloud.vision.v1p3beta1.BatchOperationMetadata.State|null} [state] BatchOperationMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchOperationMetadata submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchOperationMetadata endTime + */ + + /** + * Constructs a new BatchOperationMetadata. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a BatchOperationMetadata. + * @implements IBatchOperationMetadata + * @constructor + * @param {google.cloud.vision.v1p3beta1.IBatchOperationMetadata=} [properties] Properties to set + */ + function BatchOperationMetadata(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]]; + } + + /** + * BatchOperationMetadata state. + * @member {google.cloud.vision.v1p3beta1.BatchOperationMetadata.State} state + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.state = 0; + + /** + * BatchOperationMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.submitTime = null; + + /** + * BatchOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.endTime = null; + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.BatchOperationMetadata} BatchOperationMetadata instance + */ + BatchOperationMetadata.create = function create(properties) { + return new BatchOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.BatchOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.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.vision.v1p3beta1.BatchOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOperationMetadata message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.BatchOperationMetadata} BatchOperationMetadata + */ + BatchOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.BatchOperationMetadata) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.BatchOperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PROCESSING": + case 1: + message.state = 1; + break; + case "SUCCESSFUL": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.BatchOperationMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.BatchOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p3beta1.BatchOperationMetadata} message BatchOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.BatchOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.vision.v1p3beta1.BatchOperationMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROCESSING=1 PROCESSING value + * @property {number} SUCCESSFUL=2 SUCCESSFUL value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLED=4 CANCELLED value + */ + BatchOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROCESSING"] = 1; + values[valuesById[2] = "SUCCESSFUL"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return BatchOperationMetadata; + })(); + + v1p3beta1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ITextAnnotation + * @property {Array.|null} [pages] TextAnnotation pages + * @property {string|null} [text] TextAnnotation text + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.vision.v1p3beta1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.pages = []; + 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]]; + } + + /** + * TextAnnotation pages. + * @member {Array.} pages + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.pages = $util.emptyArray; + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.vision.v1p3beta1.Page.encode(message.pages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.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.vision.v1p3beta1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.vision.v1p3beta1.Page.decode(reader, reader.uint32())); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Page.verify(message.pages[i]); + if (error) + return "pages." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.TextAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.TextAnnotation(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.vision.v1p3beta1.TextAnnotation.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.TextAnnotation.pages: object expected"); + message.pages[i] = $root.google.cloud.vision.v1p3beta1.Page.fromObject(object.pages[i]); + } + } + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (options.defaults) + object.text = ""; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.vision.v1p3beta1.Page.toObject(message.pages[j], options); + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TextAnnotation.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(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]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.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.vision.v1p3beta1.TextAnnotation.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectedLanguage; + })(); + + TextAnnotation.DetectedBreak = (function() { + + /** + * Properties of a DetectedBreak. + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @interface IDetectedBreak + * @property {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType|null} [type] DetectedBreak type + * @property {boolean|null} [isPrefix] DetectedBreak isPrefix + */ + + /** + * Constructs a new DetectedBreak. + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @classdesc Represents a DetectedBreak. + * @implements IDetectedBreak + * @constructor + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + */ + function DetectedBreak(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]]; + } + + /** + * DetectedBreak type. + * @member {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType} type + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.type = 0; + + /** + * DetectedBreak isPrefix. + * @member {boolean} isPrefix + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.isPrefix = false; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak} DetectedBreak instance + */ + DetectedBreak.create = function create(properties) { + return new DetectedBreak(properties); + }; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isPrefix); + return writer; + }; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.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.vision.v1p3beta1.TextAnnotation.DetectedBreak(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.isPrefix = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedBreak message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedBreak.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + if (typeof message.isPrefix !== "boolean") + return "isPrefix: boolean expected"; + return null; + }; + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak} DetectedBreak + */ + DetectedBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "SPACE": + case 1: + message.type = 1; + break; + case "SURE_SPACE": + case 2: + message.type = 2; + break; + case "EOL_SURE_SPACE": + case 3: + message.type = 3; + break; + case "HYPHEN": + case 4: + message.type = 4; + break; + case "LINE_BREAK": + case 5: + message.type = 5; + break; + } + if (object.isPrefix != null) + message.isPrefix = Boolean(object.isPrefix); + return message; + }; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak} message DetectedBreak + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedBreak.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.isPrefix = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType[message.type] : message.type; + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + object.isPrefix = message.isPrefix; + return object; + }; + + /** + * Converts this DetectedBreak to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak + * @instance + * @returns {Object.} JSON object + */ + DetectedBreak.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BreakType enum. + * @name google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SPACE=1 SPACE value + * @property {number} SURE_SPACE=2 SURE_SPACE value + * @property {number} EOL_SURE_SPACE=3 EOL_SURE_SPACE value + * @property {number} HYPHEN=4 HYPHEN value + * @property {number} LINE_BREAK=5 LINE_BREAK value + */ + DetectedBreak.BreakType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SPACE"] = 1; + values[valuesById[2] = "SURE_SPACE"] = 2; + values[valuesById[3] = "EOL_SURE_SPACE"] = 3; + values[valuesById[4] = "HYPHEN"] = 4; + values[valuesById[5] = "LINE_BREAK"] = 5; + return values; + })(); + + return DetectedBreak; + })(); + + TextAnnotation.TextProperty = (function() { + + /** + * Properties of a TextProperty. + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @interface ITextProperty + * @property {Array.|null} [detectedLanguages] TextProperty detectedLanguages + * @property {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak|null} [detectedBreak] TextProperty detectedBreak + */ + + /** + * Constructs a new TextProperty. + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation + * @classdesc Represents a TextProperty. + * @implements ITextProperty + * @constructor + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + */ + function TextProperty(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * TextProperty detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedLanguages = $util.emptyArray; + + /** + * TextProperty detectedBreak. + * @member {google.cloud.vision.v1p3beta1.TextAnnotation.IDetectedBreak|null|undefined} detectedBreak + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedBreak = null; + + /** + * Creates a new TextProperty instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty} TextProperty instance + */ + TextProperty.create = function create(properties) { + return new TextProperty(properties); + }; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.encode(message.detectedBreak, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.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.vision.v1p3beta1.TextAnnotation.TextProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.decode(reader, reader.uint32())); + break; + case 2: + message.detectedBreak = $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProperty message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.verify(message.detectedBreak); + if (error) + return "detectedBreak." + error; + } + return null; + }; + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty} TextProperty + */ + TextProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty(); + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.detectedBreak != null) { + if (typeof object.detectedBreak !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.detectedBreak: object expected"); + message.detectedBreak = $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.fromObject(object.detectedBreak); + } + return message; + }; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty} message TextProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) + object.detectedBreak = null; + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + object.detectedBreak = $root.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.toObject(message.detectedBreak, options); + return object; + }; + + /** + * Converts this TextProperty to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty + * @instance + * @returns {Object.} JSON object + */ + TextProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProperty; + })(); + + return TextAnnotation; + })(); + + v1p3beta1.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IPage + * @property {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null} [property] Page property + * @property {number|null} [width] Page width + * @property {number|null} [height] Page height + * @property {Array.|null} [blocks] Page blocks + * @property {number|null} [confidence] Page confidence + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.vision.v1p3beta1.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.blocks = []; + 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]]; + } + + /** + * Page property. + * @member {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p3beta1.Page + * @instance + */ + Page.prototype.property = null; + + /** + * Page width. + * @member {number} width + * @memberof google.cloud.vision.v1p3beta1.Page + * @instance + */ + Page.prototype.width = 0; + + /** + * Page height. + * @member {number} height + * @memberof google.cloud.vision.v1p3beta1.Page + * @instance + */ + Page.prototype.height = 0; + + /** + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.vision.v1p3beta1.Page + * @instance + */ + Page.prototype.blocks = $util.emptyArray; + + /** + * Page confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.Page + * @instance + */ + Page.prototype.confidence = 0; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {google.cloud.vision.v1p3beta1.IPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {google.cloud.vision.v1p3beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.width != null && message.hasOwnProperty("width")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.width); + if (message.height != null && message.hasOwnProperty("height")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.height); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.vision.v1p3beta1.Block.encode(message.blocks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {google.cloud.vision.v1p3beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.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.vision.v1p3beta1.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.width = reader.int32(); + break; + case 3: + message.height = reader.int32(); + break; + case 4: + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.vision.v1p3beta1.Block.decode(reader, reader.uint32())); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Block.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Page) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Page(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Page.property: object expected"); + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.vision.v1p3beta1.Page.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Page.blocks: object expected"); + message.blocks[i] = $root.google.cloud.vision.v1p3beta1.Block.fromObject(object.blocks[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Page + * @static + * @param {google.cloud.vision.v1p3beta1.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (options.defaults) { + object.property = null; + object.width = 0; + object.height = 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.vision.v1p3beta1.Block.toObject(message.blocks[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Page; + })(); + + v1p3beta1.Block = (function() { + + /** + * Properties of a Block. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IBlock + * @property {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null} [property] Block property + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingBox] Block boundingBox + * @property {Array.|null} [paragraphs] Block paragraphs + * @property {google.cloud.vision.v1p3beta1.Block.BlockType|null} [blockType] Block blockType + * @property {number|null} [confidence] Block confidence + */ + + /** + * Constructs a new Block. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {google.cloud.vision.v1p3beta1.IBlock=} [properties] Properties to set + */ + function Block(properties) { + this.paragraphs = []; + 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]]; + } + + /** + * Block property. + * @member {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p3beta1.Block + * @instance + */ + Block.prototype.property = null; + + /** + * Block boundingBox. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p3beta1.Block + * @instance + */ + Block.prototype.boundingBox = null; + + /** + * Block paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.vision.v1p3beta1.Block + * @instance + */ + Block.prototype.paragraphs = $util.emptyArray; + + /** + * Block blockType. + * @member {google.cloud.vision.v1p3beta1.Block.BlockType} blockType + * @memberof google.cloud.vision.v1p3beta1.Block + * @instance + */ + Block.prototype.blockType = 0; + + /** + * Block confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.Block + * @instance + */ + Block.prototype.confidence = 0; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {google.cloud.vision.v1p3beta1.IBlock=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Block.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {google.cloud.vision.v1p3beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paragraphs != null && message.paragraphs.length) + for (var i = 0; i < message.paragraphs.length; ++i) + $root.google.cloud.vision.v1p3beta1.Paragraph.encode(message.paragraphs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.blockType != null && message.hasOwnProperty("blockType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.blockType); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {google.cloud.vision.v1p3beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.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.vision.v1p3beta1.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.paragraphs && message.paragraphs.length)) + message.paragraphs = []; + message.paragraphs.push($root.google.cloud.vision.v1p3beta1.Paragraph.decode(reader, reader.uint32())); + break; + case 4: + message.blockType = reader.int32(); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.paragraphs != null && message.hasOwnProperty("paragraphs")) { + if (!Array.isArray(message.paragraphs)) + return "paragraphs: array expected"; + for (var i = 0; i < message.paragraphs.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Paragraph.verify(message.paragraphs[i]); + if (error) + return "paragraphs." + error; + } + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + switch (message.blockType) { + default: + return "blockType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Block) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Block(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Block.property: object expected"); + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Block.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.paragraphs) { + if (!Array.isArray(object.paragraphs)) + throw TypeError(".google.cloud.vision.v1p3beta1.Block.paragraphs: array expected"); + message.paragraphs = []; + for (var i = 0; i < object.paragraphs.length; ++i) { + if (typeof object.paragraphs[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Block.paragraphs: object expected"); + message.paragraphs[i] = $root.google.cloud.vision.v1p3beta1.Paragraph.fromObject(object.paragraphs[i]); + } + } + switch (object.blockType) { + case "UNKNOWN": + case 0: + message.blockType = 0; + break; + case "TEXT": + case 1: + message.blockType = 1; + break; + case "TABLE": + case 2: + message.blockType = 2; + break; + case "PICTURE": + case 3: + message.blockType = 3; + break; + case "RULER": + case 4: + message.blockType = 4; + break; + case "BARCODE": + case 5: + message.blockType = 5; + break; + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Block + * @static + * @param {google.cloud.vision.v1p3beta1.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paragraphs = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.blockType = options.enums === String ? "UNKNOWN" : 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.paragraphs && message.paragraphs.length) { + object.paragraphs = []; + for (var j = 0; j < message.paragraphs.length; ++j) + object.paragraphs[j] = $root.google.cloud.vision.v1p3beta1.Paragraph.toObject(message.paragraphs[j], options); + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + object.blockType = options.enums === String ? $root.google.cloud.vision.v1p3beta1.Block.BlockType[message.blockType] : message.blockType; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BlockType enum. + * @name google.cloud.vision.v1p3beta1.Block.BlockType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} TEXT=1 TEXT value + * @property {number} TABLE=2 TABLE value + * @property {number} PICTURE=3 PICTURE value + * @property {number} RULER=4 RULER value + * @property {number} BARCODE=5 BARCODE value + */ + Block.BlockType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "TABLE"] = 2; + values[valuesById[3] = "PICTURE"] = 3; + values[valuesById[4] = "RULER"] = 4; + values[valuesById[5] = "BARCODE"] = 5; + return values; + })(); + + return Block; + })(); + + v1p3beta1.Paragraph = (function() { + + /** + * Properties of a Paragraph. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IParagraph + * @property {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null} [property] Paragraph property + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingBox] Paragraph boundingBox + * @property {Array.|null} [words] Paragraph words + * @property {number|null} [confidence] Paragraph confidence + */ + + /** + * Constructs a new Paragraph. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Paragraph. + * @implements IParagraph + * @constructor + * @param {google.cloud.vision.v1p3beta1.IParagraph=} [properties] Properties to set + */ + function Paragraph(properties) { + this.words = []; + 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]]; + } + + /** + * Paragraph property. + * @member {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @instance + */ + Paragraph.prototype.property = null; + + /** + * Paragraph boundingBox. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @instance + */ + Paragraph.prototype.boundingBox = null; + + /** + * Paragraph words. + * @member {Array.} words + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @instance + */ + Paragraph.prototype.words = $util.emptyArray; + + /** + * Paragraph confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @instance + */ + Paragraph.prototype.confidence = 0; + + /** + * Creates a new Paragraph instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p3beta1.IParagraph=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Paragraph} Paragraph instance + */ + Paragraph.create = function create(properties) { + return new Paragraph(properties); + }; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Paragraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p3beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.vision.v1p3beta1.Word.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Paragraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p3beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.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.vision.v1p3beta1.Paragraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.vision.v1p3beta1.Word.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Paragraph message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Paragraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Word.verify(message.words[i]); + if (error) + return "words." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Paragraph} Paragraph + */ + Paragraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Paragraph) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Paragraph(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Paragraph.property: object expected"); + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Paragraph.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.vision.v1p3beta1.Paragraph.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Paragraph.words: object expected"); + message.words[i] = $root.google.cloud.vision.v1p3beta1.Word.fromObject(object.words[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p3beta1.Paragraph} message Paragraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Paragraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.vision.v1p3beta1.Word.toObject(message.words[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Paragraph to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Paragraph + * @instance + * @returns {Object.} JSON object + */ + Paragraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Paragraph; + })(); + + v1p3beta1.Word = (function() { + + /** + * Properties of a Word. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IWord + * @property {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null} [property] Word property + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingBox] Word boundingBox + * @property {Array.|null} [symbols] Word symbols + * @property {number|null} [confidence] Word confidence + */ + + /** + * Constructs a new Word. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Word. + * @implements IWord + * @constructor + * @param {google.cloud.vision.v1p3beta1.IWord=} [properties] Properties to set + */ + function Word(properties) { + this.symbols = []; + 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]]; + } + + /** + * Word property. + * @member {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p3beta1.Word + * @instance + */ + Word.prototype.property = null; + + /** + * Word boundingBox. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p3beta1.Word + * @instance + */ + Word.prototype.boundingBox = null; + + /** + * Word symbols. + * @member {Array.} symbols + * @memberof google.cloud.vision.v1p3beta1.Word + * @instance + */ + Word.prototype.symbols = $util.emptyArray; + + /** + * Word confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.Word + * @instance + */ + Word.prototype.confidence = 0; + + /** + * Creates a new Word instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {google.cloud.vision.v1p3beta1.IWord=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Word} Word instance + */ + Word.create = function create(properties) { + return new Word(properties); + }; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Word.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {google.cloud.vision.v1p3beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.symbols != null && message.symbols.length) + for (var i = 0; i < message.symbols.length; ++i) + $root.google.cloud.vision.v1p3beta1.Symbol.encode(message.symbols[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Word.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {google.cloud.vision.v1p3beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Word message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.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.vision.v1p3beta1.Word(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.symbols && message.symbols.length)) + message.symbols = []; + message.symbols.push($root.google.cloud.vision.v1p3beta1.Symbol.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Word message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Word.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.symbols != null && message.hasOwnProperty("symbols")) { + if (!Array.isArray(message.symbols)) + return "symbols: array expected"; + for (var i = 0; i < message.symbols.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.Symbol.verify(message.symbols[i]); + if (error) + return "symbols." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Word} Word + */ + Word.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Word) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Word(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Word.property: object expected"); + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Word.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.symbols) { + if (!Array.isArray(object.symbols)) + throw TypeError(".google.cloud.vision.v1p3beta1.Word.symbols: array expected"); + message.symbols = []; + for (var i = 0; i < object.symbols.length; ++i) { + if (typeof object.symbols[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Word.symbols: object expected"); + message.symbols[i] = $root.google.cloud.vision.v1p3beta1.Symbol.fromObject(object.symbols[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Word + * @static + * @param {google.cloud.vision.v1p3beta1.Word} message Word + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Word.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.symbols = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.symbols && message.symbols.length) { + object.symbols = []; + for (var j = 0; j < message.symbols.length; ++j) + object.symbols[j] = $root.google.cloud.vision.v1p3beta1.Symbol.toObject(message.symbols[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Word to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Word + * @instance + * @returns {Object.} JSON object + */ + Word.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Word; + })(); + + v1p3beta1.Symbol = (function() { + + /** + * Properties of a Symbol. + * @memberof google.cloud.vision.v1p3beta1 + * @interface ISymbol + * @property {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null} [property] Symbol property + * @property {google.cloud.vision.v1p3beta1.IBoundingPoly|null} [boundingBox] Symbol boundingBox + * @property {string|null} [text] Symbol text + * @property {number|null} [confidence] Symbol confidence + */ + + /** + * Constructs a new Symbol. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a Symbol. + * @implements ISymbol + * @constructor + * @param {google.cloud.vision.v1p3beta1.ISymbol=} [properties] Properties to set + */ + function Symbol(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]]; + } + + /** + * Symbol property. + * @member {google.cloud.vision.v1p3beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @instance + */ + Symbol.prototype.property = null; + + /** + * Symbol boundingBox. + * @member {google.cloud.vision.v1p3beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @instance + */ + Symbol.prototype.boundingBox = null; + + /** + * Symbol text. + * @member {string} text + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @instance + */ + Symbol.prototype.text = ""; + + /** + * Symbol confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @instance + */ + Symbol.prototype.confidence = 0; + + /** + * Creates a new Symbol instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {google.cloud.vision.v1p3beta1.ISymbol=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.Symbol} Symbol instance + */ + Symbol.create = function create(properties) { + return new Symbol(properties); + }; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p3beta1.Symbol.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {google.cloud.vision.v1p3beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p3beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.Symbol.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {google.cloud.vision.v1p3beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.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.vision.v1p3beta1.Symbol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + message.text = reader.string(); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Symbol message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Symbol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p3beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.Symbol} Symbol + */ + Symbol.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.Symbol) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.Symbol(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Symbol.property: object expected"); + message.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.Symbol.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.text != null) + message.text = String(object.text); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @static + * @param {google.cloud.vision.v1p3beta1.Symbol} message Symbol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Symbol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.text = ""; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p3beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Symbol to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.Symbol + * @instance + * @returns {Object.} JSON object + */ + Symbol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Symbol; + })(); + + v1p3beta1.WebDetection = (function() { + + /** + * Properties of a WebDetection. + * @memberof google.cloud.vision.v1p3beta1 + * @interface IWebDetection + * @property {Array.|null} [webEntities] WebDetection webEntities + * @property {Array.|null} [fullMatchingImages] WebDetection fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebDetection partialMatchingImages + * @property {Array.|null} [pagesWithMatchingImages] WebDetection pagesWithMatchingImages + * @property {Array.|null} [visuallySimilarImages] WebDetection visuallySimilarImages + * @property {Array.|null} [bestGuessLabels] WebDetection bestGuessLabels + */ + + /** + * Constructs a new WebDetection. + * @memberof google.cloud.vision.v1p3beta1 + * @classdesc Represents a WebDetection. + * @implements IWebDetection + * @constructor + * @param {google.cloud.vision.v1p3beta1.IWebDetection=} [properties] Properties to set + */ + function WebDetection(properties) { + this.webEntities = []; + this.fullMatchingImages = []; + this.partialMatchingImages = []; + this.pagesWithMatchingImages = []; + this.visuallySimilarImages = []; + this.bestGuessLabels = []; + 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]]; + } + + /** + * WebDetection webEntities. + * @member {Array.} webEntities + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @instance + */ + WebDetection.prototype.webEntities = $util.emptyArray; + + /** + * WebDetection fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @instance + */ + WebDetection.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebDetection partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @instance + */ + WebDetection.prototype.partialMatchingImages = $util.emptyArray; + + /** + * WebDetection pagesWithMatchingImages. + * @member {Array.} pagesWithMatchingImages + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @instance + */ + WebDetection.prototype.pagesWithMatchingImages = $util.emptyArray; + + /** + * WebDetection visuallySimilarImages. + * @member {Array.} visuallySimilarImages + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @instance + */ + WebDetection.prototype.visuallySimilarImages = $util.emptyArray; + + /** + * WebDetection bestGuessLabels. + * @member {Array.} bestGuessLabels + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @instance + */ + WebDetection.prototype.bestGuessLabels = $util.emptyArray; + + /** + * Creates a new WebDetection instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p3beta1.IWebDetection=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.WebDetection} WebDetection instance + */ + WebDetection.create = function create(properties) { + return new WebDetection(properties); + }; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p3beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webEntities != null && message.webEntities.length) + for (var i = 0; i < message.webEntities.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.encode(message.webEntities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pagesWithMatchingImages != null && message.pagesWithMatchingImages.length) + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebPage.encode(message.pagesWithMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.visuallySimilarImages != null && message.visuallySimilarImages.length) + for (var i = 0; i < message.visuallySimilarImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.encode(message.visuallySimilarImages[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bestGuessLabels != null && message.bestGuessLabels.length) + for (var i = 0; i < message.bestGuessLabels.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.encode(message.bestGuessLabels[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p3beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.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.vision.v1p3beta1.WebDetection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.webEntities && message.webEntities.length)) + message.webEntities = []; + message.webEntities.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.pagesWithMatchingImages && message.pagesWithMatchingImages.length)) + message.pagesWithMatchingImages = []; + message.pagesWithMatchingImages.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebPage.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.visuallySimilarImages && message.visuallySimilarImages.length)) + message.visuallySimilarImages = []; + message.visuallySimilarImages.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.bestGuessLabels && message.bestGuessLabels.length)) + message.bestGuessLabels = []; + message.bestGuessLabels.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetection message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webEntities != null && message.hasOwnProperty("webEntities")) { + if (!Array.isArray(message.webEntities)) + return "webEntities: array expected"; + for (var i = 0; i < message.webEntities.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.verify(message.webEntities[i]); + if (error) + return "webEntities." + error; + } + } + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + if (message.pagesWithMatchingImages != null && message.hasOwnProperty("pagesWithMatchingImages")) { + if (!Array.isArray(message.pagesWithMatchingImages)) + return "pagesWithMatchingImages: array expected"; + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebPage.verify(message.pagesWithMatchingImages[i]); + if (error) + return "pagesWithMatchingImages." + error; + } + } + if (message.visuallySimilarImages != null && message.hasOwnProperty("visuallySimilarImages")) { + if (!Array.isArray(message.visuallySimilarImages)) + return "visuallySimilarImages: array expected"; + for (var i = 0; i < message.visuallySimilarImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify(message.visuallySimilarImages[i]); + if (error) + return "visuallySimilarImages." + error; + } + } + if (message.bestGuessLabels != null && message.hasOwnProperty("bestGuessLabels")) { + if (!Array.isArray(message.bestGuessLabels)) + return "bestGuessLabels: array expected"; + for (var i = 0; i < message.bestGuessLabels.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.verify(message.bestGuessLabels[i]); + if (error) + return "bestGuessLabels." + error; + } + } + return null; + }; + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.WebDetection} WebDetection + */ + WebDetection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.WebDetection) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.WebDetection(); + if (object.webEntities) { + if (!Array.isArray(object.webEntities)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.webEntities: array expected"); + message.webEntities = []; + for (var i = 0; i < object.webEntities.length; ++i) { + if (typeof object.webEntities[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.webEntities: object expected"); + message.webEntities[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.fromObject(object.webEntities[i]); + } + } + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + if (object.pagesWithMatchingImages) { + if (!Array.isArray(object.pagesWithMatchingImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.pagesWithMatchingImages: array expected"); + message.pagesWithMatchingImages = []; + for (var i = 0; i < object.pagesWithMatchingImages.length; ++i) { + if (typeof object.pagesWithMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.pagesWithMatchingImages: object expected"); + message.pagesWithMatchingImages[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebPage.fromObject(object.pagesWithMatchingImages[i]); + } + } + if (object.visuallySimilarImages) { + if (!Array.isArray(object.visuallySimilarImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.visuallySimilarImages: array expected"); + message.visuallySimilarImages = []; + for (var i = 0; i < object.visuallySimilarImages.length; ++i) { + if (typeof object.visuallySimilarImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.visuallySimilarImages: object expected"); + message.visuallySimilarImages[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.fromObject(object.visuallySimilarImages[i]); + } + } + if (object.bestGuessLabels) { + if (!Array.isArray(object.bestGuessLabels)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.bestGuessLabels: array expected"); + message.bestGuessLabels = []; + for (var i = 0; i < object.bestGuessLabels.length; ++i) { + if (typeof object.bestGuessLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.bestGuessLabels: object expected"); + message.bestGuessLabels[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.fromObject(object.bestGuessLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection} message WebDetection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.webEntities = []; + object.fullMatchingImages = []; + object.partialMatchingImages = []; + object.pagesWithMatchingImages = []; + object.visuallySimilarImages = []; + object.bestGuessLabels = []; + } + if (message.webEntities && message.webEntities.length) { + object.webEntities = []; + for (var j = 0; j < message.webEntities.length; ++j) + object.webEntities[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebEntity.toObject(message.webEntities[j], options); + } + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + if (message.pagesWithMatchingImages && message.pagesWithMatchingImages.length) { + object.pagesWithMatchingImages = []; + for (var j = 0; j < message.pagesWithMatchingImages.length; ++j) + object.pagesWithMatchingImages[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebPage.toObject(message.pagesWithMatchingImages[j], options); + } + if (message.visuallySimilarImages && message.visuallySimilarImages.length) { + object.visuallySimilarImages = []; + for (var j = 0; j < message.visuallySimilarImages.length; ++j) + object.visuallySimilarImages[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.toObject(message.visuallySimilarImages[j], options); + } + if (message.bestGuessLabels && message.bestGuessLabels.length) { + object.bestGuessLabels = []; + for (var j = 0; j < message.bestGuessLabels.length; ++j) + object.bestGuessLabels[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebLabel.toObject(message.bestGuessLabels[j], options); + } + return object; + }; + + /** + * Converts this WebDetection to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @instance + * @returns {Object.} JSON object + */ + WebDetection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WebDetection.WebEntity = (function() { + + /** + * Properties of a WebEntity. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @interface IWebEntity + * @property {string|null} [entityId] WebEntity entityId + * @property {number|null} [score] WebEntity score + * @property {string|null} [description] WebEntity description + */ + + /** + * Constructs a new WebEntity. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @classdesc Represents a WebEntity. + * @implements IWebEntity + * @constructor + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebEntity=} [properties] Properties to set + */ + function WebEntity(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]]; + } + + /** + * WebEntity entityId. + * @member {string} entityId + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.entityId = ""; + + /** + * WebEntity score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.score = 0; + + /** + * WebEntity description. + * @member {string} description + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.description = ""; + + /** + * Creates a new WebEntity instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebEntity=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebEntity} WebEntity instance + */ + WebEntity.create = function create(properties) { + return new WebEntity(properties); + }; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && message.hasOwnProperty("entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.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.vision.v1p3beta1.WebDetection.WebEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entityId = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebEntity message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebEntity} WebEntity + */ + WebEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.WebDetection.WebEntity) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.WebDetection.WebEntity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.score != null) + message.score = Number(object.score); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.WebEntity} message WebEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.score = 0; + object.description = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this WebEntity to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebEntity + * @instance + * @returns {Object.} JSON object + */ + WebEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebEntity; + })(); + + WebDetection.WebImage = (function() { + + /** + * Properties of a WebImage. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @interface IWebImage + * @property {string|null} [url] WebImage url + * @property {number|null} [score] WebImage score + */ + + /** + * Constructs a new WebImage. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @classdesc Represents a WebImage. + * @implements IWebImage + * @constructor + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebImage=} [properties] Properties to set + */ + function WebImage(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]]; + } + + /** + * WebImage url. + * @member {string} url + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.url = ""; + + /** + * WebImage score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.score = 0; + + /** + * Creates a new WebImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebImage} WebImage instance + */ + WebImage.create = function create(properties) { + return new WebImage(properties); + }; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.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.vision.v1p3beta1.WebDetection.WebImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebImage message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebImage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebImage} WebImage + */ + WebImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.WebImage} message WebImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.score = 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this WebImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebImage + * @instance + * @returns {Object.} JSON object + */ + WebImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebImage; + })(); + + WebDetection.WebPage = (function() { + + /** + * Properties of a WebPage. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @interface IWebPage + * @property {string|null} [url] WebPage url + * @property {number|null} [score] WebPage score + * @property {string|null} [pageTitle] WebPage pageTitle + * @property {Array.|null} [fullMatchingImages] WebPage fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebPage partialMatchingImages + */ + + /** + * Constructs a new WebPage. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @classdesc Represents a WebPage. + * @implements IWebPage + * @constructor + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebPage=} [properties] Properties to set + */ + function WebPage(properties) { + this.fullMatchingImages = []; + this.partialMatchingImages = []; + 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]]; + } + + /** + * WebPage url. + * @member {string} url + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.url = ""; + + /** + * WebPage score. + * @member {number} score + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.score = 0; + + /** + * WebPage pageTitle. + * @member {string} pageTitle + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.pageTitle = ""; + + /** + * WebPage fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebPage partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.partialMatchingImages = $util.emptyArray; + + /** + * Creates a new WebPage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebPage} WebPage instance + */ + WebPage.create = function create(properties) { + return new WebPage(properties); + }; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebPage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageTitle); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebPage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.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.vision.v1p3beta1.WebDetection.WebPage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pageTitle = reader.string(); + break; + case 4: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebPage message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebPage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + if (!$util.isString(message.pageTitle)) + return "pageTitle: string expected"; + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + return null; + }; + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebPage} WebPage + */ + WebPage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.WebDetection.WebPage) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.WebDetection.WebPage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + if (object.pageTitle != null) + message.pageTitle = String(object.pageTitle); + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.WebPage.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.WebPage.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.WebPage.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p3beta1.WebDetection.WebPage.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.WebPage} message WebPage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebPage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fullMatchingImages = []; + object.partialMatchingImages = []; + } + if (options.defaults) { + object.url = ""; + object.score = 0; + object.pageTitle = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + object.pageTitle = message.pageTitle; + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p3beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + return object; + }; + + /** + * Converts this WebPage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebPage + * @instance + * @returns {Object.} JSON object + */ + WebPage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebPage; + })(); + + WebDetection.WebLabel = (function() { + + /** + * Properties of a WebLabel. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @interface IWebLabel + * @property {string|null} [label] WebLabel label + * @property {string|null} [languageCode] WebLabel languageCode + */ + + /** + * Constructs a new WebLabel. + * @memberof google.cloud.vision.v1p3beta1.WebDetection + * @classdesc Represents a WebLabel. + * @implements IWebLabel + * @constructor + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebLabel=} [properties] Properties to set + */ + function WebLabel(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]]; + } + + /** + * WebLabel label. + * @member {string} label + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.label = ""; + + /** + * WebLabel languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.languageCode = ""; + + /** + * Creates a new WebLabel instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebLabel=} [properties] Properties to set + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebLabel} WebLabel instance + */ + WebLabel.create = function create(properties) { + return new WebLabel(properties); + }; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p3beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.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.vision.v1p3beta1.WebDetection.WebLabel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebLabel message. + * @function verify + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebLabel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p3beta1.WebDetection.WebLabel} WebLabel + */ + WebLabel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p3beta1.WebDetection.WebLabel) + return object; + var message = new $root.google.cloud.vision.v1p3beta1.WebDetection.WebLabel(); + if (object.label != null) + message.label = String(object.label); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p3beta1.WebDetection.WebLabel} message WebLabel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebLabel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.languageCode = ""; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this WebLabel to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p3beta1.WebDetection.WebLabel + * @instance + * @returns {Object.} JSON object + */ + WebLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebLabel; + })(); + + return WebDetection; + })(); + + return v1p3beta1; + })(); + + vision.v1p4beta1 = (function() { + + /** + * Namespace v1p4beta1. + * @memberof google.cloud.vision + * @namespace + */ + var v1p4beta1 = {}; + + v1p4beta1.ImageAnnotator = (function() { + + /** + * Constructs a new ImageAnnotator service. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImageAnnotator + * @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 ImageAnnotator(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ImageAnnotator.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageAnnotator; + + /** + * Creates new ImageAnnotator service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @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 {ImageAnnotator} RPC service. Useful where requests and/or responses are streamed. + */ + ImageAnnotator.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#batchAnnotateImages}. + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @typedef BatchAnnotateImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} [response] BatchAnnotateImagesResponse + */ + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateImagesCallback} callback Node-style callback called with the error, if any, and BatchAnnotateImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.batchAnnotateImages = function batchAnnotateImages(request, callback) { + return this.rpcCall(batchAnnotateImages, $root.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest, $root.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse, request, callback); + }, "name", { value: "BatchAnnotateImages" }); + + /** + * Calls BatchAnnotateImages. + * @function batchAnnotateImages + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest} request BatchAnnotateImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#batchAnnotateFiles}. + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @typedef BatchAnnotateFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} [response] BatchAnnotateFilesResponse + */ + + /** + * Calls BatchAnnotateFiles. + * @function batchAnnotateFiles + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest} request BatchAnnotateFilesRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateFilesCallback} callback Node-style callback called with the error, if any, and BatchAnnotateFilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.batchAnnotateFiles = function batchAnnotateFiles(request, callback) { + return this.rpcCall(batchAnnotateFiles, $root.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest, $root.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse, request, callback); + }, "name", { value: "BatchAnnotateFiles" }); + + /** + * Calls BatchAnnotateFiles. + * @function batchAnnotateFiles + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest} request BatchAnnotateFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#asyncBatchAnnotateImages}. + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @typedef AsyncBatchAnnotateImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AsyncBatchAnnotateImages. + * @function asyncBatchAnnotateImages + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest} request AsyncBatchAnnotateImagesRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateImagesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.asyncBatchAnnotateImages = function asyncBatchAnnotateImages(request, callback) { + return this.rpcCall(asyncBatchAnnotateImages, $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AsyncBatchAnnotateImages" }); + + /** + * Calls AsyncBatchAnnotateImages. + * @function asyncBatchAnnotateImages + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest} request AsyncBatchAnnotateImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ImageAnnotator#asyncBatchAnnotateFiles}. + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @typedef AsyncBatchAnnotateFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateFilesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageAnnotator.prototype.asyncBatchAnnotateFiles = function asyncBatchAnnotateFiles(request, callback) { + return this.rpcCall(asyncBatchAnnotateFiles, $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AsyncBatchAnnotateFiles" }); + + /** + * Calls AsyncBatchAnnotateFiles. + * @function asyncBatchAnnotateFiles + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotator + * @instance + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest} request AsyncBatchAnnotateFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ImageAnnotator; + })(); + + v1p4beta1.Feature = (function() { + + /** + * Properties of a Feature. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IFeature + * @property {google.cloud.vision.v1p4beta1.Feature.Type|null} [type] Feature type + * @property {number|null} [maxResults] Feature maxResults + * @property {string|null} [model] Feature model + */ + + /** + * Constructs a new Feature. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Feature. + * @implements IFeature + * @constructor + * @param {google.cloud.vision.v1p4beta1.IFeature=} [properties] Properties to set + */ + function Feature(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]]; + } + + /** + * Feature type. + * @member {google.cloud.vision.v1p4beta1.Feature.Type} type + * @memberof google.cloud.vision.v1p4beta1.Feature + * @instance + */ + Feature.prototype.type = 0; + + /** + * Feature maxResults. + * @member {number} maxResults + * @memberof google.cloud.vision.v1p4beta1.Feature + * @instance + */ + Feature.prototype.maxResults = 0; + + /** + * Feature model. + * @member {string} model + * @memberof google.cloud.vision.v1p4beta1.Feature + * @instance + */ + Feature.prototype.model = ""; + + /** + * Creates a new Feature instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {google.cloud.vision.v1p4beta1.IFeature=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Feature} Feature instance + */ + Feature.create = function create(properties) { + return new Feature(properties); + }; + + /** + * Encodes the specified Feature message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Feature.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {google.cloud.vision.v1p4beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxResults); + if (message.model != null && message.hasOwnProperty("model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified Feature message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Feature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {google.cloud.vision.v1p4beta1.IFeature} message Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.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.vision.v1p4beta1.Feature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.maxResults = reader.int32(); + break; + case 3: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Feature} Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feature message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 11: + case 6: + case 7: + case 9: + case 10: + case 12: + case 19: + break; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a Feature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Feature} Feature + */ + Feature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Feature) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Feature(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "FACE_DETECTION": + case 1: + message.type = 1; + break; + case "LANDMARK_DETECTION": + case 2: + message.type = 2; + break; + case "LOGO_DETECTION": + case 3: + message.type = 3; + break; + case "LABEL_DETECTION": + case 4: + message.type = 4; + break; + case "TEXT_DETECTION": + case 5: + message.type = 5; + break; + case "DOCUMENT_TEXT_DETECTION": + case 11: + message.type = 11; + break; + case "SAFE_SEARCH_DETECTION": + case 6: + message.type = 6; + break; + case "IMAGE_PROPERTIES": + case 7: + message.type = 7; + break; + case "CROP_HINTS": + case 9: + message.type = 9; + break; + case "WEB_DETECTION": + case 10: + message.type = 10; + break; + case "PRODUCT_SEARCH": + case 12: + message.type = 12; + break; + case "OBJECT_LOCALIZATION": + case 19: + message.type = 19; + break; + } + if (object.maxResults != null) + message.maxResults = object.maxResults | 0; + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a Feature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Feature + * @static + * @param {google.cloud.vision.v1p4beta1.Feature} message Feature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.maxResults = 0; + object.model = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Feature.Type[message.type] : message.type; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + object.maxResults = message.maxResults; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this Feature to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Feature + * @instance + * @returns {Object.} JSON object + */ + Feature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p4beta1.Feature.Type + * @enum {string} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} FACE_DETECTION=1 FACE_DETECTION value + * @property {number} LANDMARK_DETECTION=2 LANDMARK_DETECTION value + * @property {number} LOGO_DETECTION=3 LOGO_DETECTION value + * @property {number} LABEL_DETECTION=4 LABEL_DETECTION value + * @property {number} TEXT_DETECTION=5 TEXT_DETECTION value + * @property {number} DOCUMENT_TEXT_DETECTION=11 DOCUMENT_TEXT_DETECTION value + * @property {number} SAFE_SEARCH_DETECTION=6 SAFE_SEARCH_DETECTION value + * @property {number} IMAGE_PROPERTIES=7 IMAGE_PROPERTIES value + * @property {number} CROP_HINTS=9 CROP_HINTS value + * @property {number} WEB_DETECTION=10 WEB_DETECTION value + * @property {number} PRODUCT_SEARCH=12 PRODUCT_SEARCH value + * @property {number} OBJECT_LOCALIZATION=19 OBJECT_LOCALIZATION value + */ + Feature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACE_DETECTION"] = 1; + values[valuesById[2] = "LANDMARK_DETECTION"] = 2; + values[valuesById[3] = "LOGO_DETECTION"] = 3; + values[valuesById[4] = "LABEL_DETECTION"] = 4; + values[valuesById[5] = "TEXT_DETECTION"] = 5; + values[valuesById[11] = "DOCUMENT_TEXT_DETECTION"] = 11; + values[valuesById[6] = "SAFE_SEARCH_DETECTION"] = 6; + values[valuesById[7] = "IMAGE_PROPERTIES"] = 7; + values[valuesById[9] = "CROP_HINTS"] = 9; + values[valuesById[10] = "WEB_DETECTION"] = 10; + values[valuesById[12] = "PRODUCT_SEARCH"] = 12; + values[valuesById[19] = "OBJECT_LOCALIZATION"] = 19; + return values; + })(); + + return Feature; + })(); + + v1p4beta1.ImageSource = (function() { + + /** + * Properties of an ImageSource. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImageSource + * @property {string|null} [gcsImageUri] ImageSource gcsImageUri + * @property {string|null} [imageUri] ImageSource imageUri + */ + + /** + * Constructs a new ImageSource. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImageSource. + * @implements IImageSource + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImageSource=} [properties] Properties to set + */ + function ImageSource(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]]; + } + + /** + * ImageSource gcsImageUri. + * @member {string} gcsImageUri + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @instance + */ + ImageSource.prototype.gcsImageUri = ""; + + /** + * ImageSource imageUri. + * @member {string} imageUri + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @instance + */ + ImageSource.prototype.imageUri = ""; + + /** + * Creates a new ImageSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p4beta1.IImageSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImageSource} ImageSource instance + */ + ImageSource.create = function create(properties) { + return new ImageSource(properties); + }; + + /** + * Encodes the specified ImageSource message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p4beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsImageUri); + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageUri); + return writer; + }; + + /** + * Encodes the specified ImageSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p4beta1.IImageSource} message ImageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.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.vision.v1p4beta1.ImageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsImageUri = reader.string(); + break; + case 2: + message.imageUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImageSource} ImageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSource message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + if (!$util.isString(message.gcsImageUri)) + return "gcsImageUri: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + return null; + }; + + /** + * Creates an ImageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImageSource} ImageSource + */ + ImageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImageSource) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImageSource(); + if (object.gcsImageUri != null) + message.gcsImageUri = String(object.gcsImageUri); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + return message; + }; + + /** + * Creates a plain object from an ImageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @static + * @param {google.cloud.vision.v1p4beta1.ImageSource} message ImageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsImageUri = ""; + object.imageUri = ""; + } + if (message.gcsImageUri != null && message.hasOwnProperty("gcsImageUri")) + object.gcsImageUri = message.gcsImageUri; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + return object; + }; + + /** + * Converts this ImageSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImageSource + * @instance + * @returns {Object.} JSON object + */ + ImageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageSource; + })(); + + v1p4beta1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImage + * @property {Uint8Array|null} [content] Image content + * @property {google.cloud.vision.v1p4beta1.IImageSource|null} [source] Image source + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.vision.v1p4beta1.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 content. + * @member {Uint8Array} content + * @memberof google.cloud.vision.v1p4beta1.Image + * @instance + */ + Image.prototype.content = $util.newBuffer([]); + + /** + * Image source. + * @member {google.cloud.vision.v1p4beta1.IImageSource|null|undefined} source + * @memberof google.cloud.vision.v1p4beta1.Image + * @instance + */ + Image.prototype.source = null; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Image + * @static + * @param {google.cloud.vision.v1p4beta1.IImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Image + * @static + * @param {google.cloud.vision.v1p4beta1.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.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); + if (message.source != null && message.hasOwnProperty("source")) + $root.google.cloud.vision.v1p4beta1.ImageSource.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Image + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.bytes(); + break; + case 2: + message.source = $root.google.cloud.vision.v1p4beta1.ImageSource.decode(reader, reader.uint32()); + 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.vision.v1p4beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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"; + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.vision.v1p4beta1.ImageSource.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Image) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Image(); + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Image.source: object expected"); + message.source = $root.google.cloud.vision.v1p4beta1.ImageSource.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Image + * @static + * @param {google.cloud.vision.v1p4beta1.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) { + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + object.source = null; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.vision.v1p4beta1.ImageSource.toObject(message.source, options); + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Image; + })(); + + /** + * Likelihood enum. + * @name google.cloud.vision.v1p4beta1.Likelihood + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1p4beta1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + v1p4beta1.FaceAnnotation = (function() { + + /** + * Properties of a FaceAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IFaceAnnotation + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingPoly] FaceAnnotation boundingPoly + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [fdBoundingPoly] FaceAnnotation fdBoundingPoly + * @property {Array.|null} [landmarks] FaceAnnotation landmarks + * @property {number|null} [rollAngle] FaceAnnotation rollAngle + * @property {number|null} [panAngle] FaceAnnotation panAngle + * @property {number|null} [tiltAngle] FaceAnnotation tiltAngle + * @property {number|null} [detectionConfidence] FaceAnnotation detectionConfidence + * @property {number|null} [landmarkingConfidence] FaceAnnotation landmarkingConfidence + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [joyLikelihood] FaceAnnotation joyLikelihood + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [sorrowLikelihood] FaceAnnotation sorrowLikelihood + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [angerLikelihood] FaceAnnotation angerLikelihood + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [surpriseLikelihood] FaceAnnotation surpriseLikelihood + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [underExposedLikelihood] FaceAnnotation underExposedLikelihood + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [blurredLikelihood] FaceAnnotation blurredLikelihood + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [headwearLikelihood] FaceAnnotation headwearLikelihood + */ + + /** + * Constructs a new FaceAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a FaceAnnotation. + * @implements IFaceAnnotation + * @constructor + * @param {google.cloud.vision.v1p4beta1.IFaceAnnotation=} [properties] Properties to set + */ + function FaceAnnotation(properties) { + this.landmarks = []; + 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]]; + } + + /** + * FaceAnnotation boundingPoly. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.boundingPoly = null; + + /** + * FaceAnnotation fdBoundingPoly. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} fdBoundingPoly + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.fdBoundingPoly = null; + + /** + * FaceAnnotation landmarks. + * @member {Array.} landmarks + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarks = $util.emptyArray; + + /** + * FaceAnnotation rollAngle. + * @member {number} rollAngle + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.rollAngle = 0; + + /** + * FaceAnnotation panAngle. + * @member {number} panAngle + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.panAngle = 0; + + /** + * FaceAnnotation tiltAngle. + * @member {number} tiltAngle + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.tiltAngle = 0; + + /** + * FaceAnnotation detectionConfidence. + * @member {number} detectionConfidence + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.detectionConfidence = 0; + + /** + * FaceAnnotation landmarkingConfidence. + * @member {number} landmarkingConfidence + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.landmarkingConfidence = 0; + + /** + * FaceAnnotation joyLikelihood. + * @member {google.cloud.vision.v1p4beta1.Likelihood} joyLikelihood + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.joyLikelihood = 0; + + /** + * FaceAnnotation sorrowLikelihood. + * @member {google.cloud.vision.v1p4beta1.Likelihood} sorrowLikelihood + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.sorrowLikelihood = 0; + + /** + * FaceAnnotation angerLikelihood. + * @member {google.cloud.vision.v1p4beta1.Likelihood} angerLikelihood + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.angerLikelihood = 0; + + /** + * FaceAnnotation surpriseLikelihood. + * @member {google.cloud.vision.v1p4beta1.Likelihood} surpriseLikelihood + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.surpriseLikelihood = 0; + + /** + * FaceAnnotation underExposedLikelihood. + * @member {google.cloud.vision.v1p4beta1.Likelihood} underExposedLikelihood + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.underExposedLikelihood = 0; + + /** + * FaceAnnotation blurredLikelihood. + * @member {google.cloud.vision.v1p4beta1.Likelihood} blurredLikelihood + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.blurredLikelihood = 0; + + /** + * FaceAnnotation headwearLikelihood. + * @member {google.cloud.vision.v1p4beta1.Likelihood} headwearLikelihood + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.headwearLikelihood = 0; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IFaceAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation} FaceAnnotation instance + */ + FaceAnnotation.create = function create(properties) { + return new FaceAnnotation(properties); + }; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.fdBoundingPoly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.landmarks != null && message.landmarks.length) + for (var i = 0; i < message.landmarks.length; ++i) + $root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.encode(message.landmarks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.rollAngle); + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.panAngle); + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.tiltAngle); + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.detectionConfidence); + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.landmarkingConfidence); + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.joyLikelihood); + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sorrowLikelihood); + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.angerLikelihood); + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.surpriseLikelihood); + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.underExposedLikelihood); + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.blurredLikelihood); + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.headwearLikelihood); + return writer; + }; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.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.vision.v1p4beta1.FaceAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.fdBoundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.landmarks && message.landmarks.length)) + message.landmarks = []; + message.landmarks.push($root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.decode(reader, reader.uint32())); + break; + case 4: + message.rollAngle = reader.float(); + break; + case 5: + message.panAngle = reader.float(); + break; + case 6: + message.tiltAngle = reader.float(); + break; + case 7: + message.detectionConfidence = reader.float(); + break; + case 8: + message.landmarkingConfidence = reader.float(); + break; + case 9: + message.joyLikelihood = reader.int32(); + break; + case 10: + message.sorrowLikelihood = reader.int32(); + break; + case 11: + message.angerLikelihood = reader.int32(); + break; + case 12: + message.surpriseLikelihood = reader.int32(); + break; + case 13: + message.underExposedLikelihood = reader.int32(); + break; + case 14: + message.blurredLikelihood = reader.int32(); + break; + case 15: + message.headwearLikelihood = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.fdBoundingPoly); + if (error) + return "fdBoundingPoly." + error; + } + if (message.landmarks != null && message.hasOwnProperty("landmarks")) { + if (!Array.isArray(message.landmarks)) + return "landmarks: array expected"; + for (var i = 0; i < message.landmarks.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.verify(message.landmarks[i]); + if (error) + return "landmarks." + error; + } + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + if (typeof message.rollAngle !== "number") + return "rollAngle: number expected"; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + if (typeof message.panAngle !== "number") + return "panAngle: number expected"; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + if (typeof message.tiltAngle !== "number") + return "tiltAngle: number expected"; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + if (typeof message.detectionConfidence !== "number") + return "detectionConfidence: number expected"; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + if (typeof message.landmarkingConfidence !== "number") + return "landmarkingConfidence: number expected"; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + switch (message.joyLikelihood) { + default: + return "joyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + switch (message.sorrowLikelihood) { + default: + return "sorrowLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + switch (message.angerLikelihood) { + default: + return "angerLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + switch (message.surpriseLikelihood) { + default: + return "surpriseLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + switch (message.underExposedLikelihood) { + default: + return "underExposedLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + switch (message.blurredLikelihood) { + default: + return "blurredLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + switch (message.headwearLikelihood) { + default: + return "headwearLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation} FaceAnnotation + */ + FaceAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.FaceAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.FaceAnnotation(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.FaceAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.fdBoundingPoly != null) { + if (typeof object.fdBoundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.FaceAnnotation.fdBoundingPoly: object expected"); + message.fdBoundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.fdBoundingPoly); + } + if (object.landmarks) { + if (!Array.isArray(object.landmarks)) + throw TypeError(".google.cloud.vision.v1p4beta1.FaceAnnotation.landmarks: array expected"); + message.landmarks = []; + for (var i = 0; i < object.landmarks.length; ++i) { + if (typeof object.landmarks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.FaceAnnotation.landmarks: object expected"); + message.landmarks[i] = $root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.fromObject(object.landmarks[i]); + } + } + if (object.rollAngle != null) + message.rollAngle = Number(object.rollAngle); + if (object.panAngle != null) + message.panAngle = Number(object.panAngle); + if (object.tiltAngle != null) + message.tiltAngle = Number(object.tiltAngle); + if (object.detectionConfidence != null) + message.detectionConfidence = Number(object.detectionConfidence); + if (object.landmarkingConfidence != null) + message.landmarkingConfidence = Number(object.landmarkingConfidence); + switch (object.joyLikelihood) { + case "UNKNOWN": + case 0: + message.joyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.joyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.joyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.joyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.joyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.joyLikelihood = 5; + break; + } + switch (object.sorrowLikelihood) { + case "UNKNOWN": + case 0: + message.sorrowLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.sorrowLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.sorrowLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.sorrowLikelihood = 3; + break; + case "LIKELY": + case 4: + message.sorrowLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.sorrowLikelihood = 5; + break; + } + switch (object.angerLikelihood) { + case "UNKNOWN": + case 0: + message.angerLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.angerLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.angerLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.angerLikelihood = 3; + break; + case "LIKELY": + case 4: + message.angerLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.angerLikelihood = 5; + break; + } + switch (object.surpriseLikelihood) { + case "UNKNOWN": + case 0: + message.surpriseLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.surpriseLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.surpriseLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.surpriseLikelihood = 3; + break; + case "LIKELY": + case 4: + message.surpriseLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.surpriseLikelihood = 5; + break; + } + switch (object.underExposedLikelihood) { + case "UNKNOWN": + case 0: + message.underExposedLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.underExposedLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.underExposedLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.underExposedLikelihood = 3; + break; + case "LIKELY": + case 4: + message.underExposedLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.underExposedLikelihood = 5; + break; + } + switch (object.blurredLikelihood) { + case "UNKNOWN": + case 0: + message.blurredLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.blurredLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.blurredLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.blurredLikelihood = 3; + break; + case "LIKELY": + case 4: + message.blurredLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.blurredLikelihood = 5; + break; + } + switch (object.headwearLikelihood) { + case "UNKNOWN": + case 0: + message.headwearLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.headwearLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.headwearLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.headwearLikelihood = 3; + break; + case "LIKELY": + case 4: + message.headwearLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.headwearLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.FaceAnnotation} message FaceAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.landmarks = []; + if (options.defaults) { + object.boundingPoly = null; + object.fdBoundingPoly = null; + object.rollAngle = 0; + object.panAngle = 0; + object.tiltAngle = 0; + object.detectionConfidence = 0; + object.landmarkingConfidence = 0; + object.joyLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.sorrowLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.angerLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.surpriseLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.underExposedLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.blurredLikelihood = options.enums === String ? "UNKNOWN" : 0; + object.headwearLikelihood = options.enums === String ? "UNKNOWN" : 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.fdBoundingPoly != null && message.hasOwnProperty("fdBoundingPoly")) + object.fdBoundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.fdBoundingPoly, options); + if (message.landmarks && message.landmarks.length) { + object.landmarks = []; + for (var j = 0; j < message.landmarks.length; ++j) + object.landmarks[j] = $root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.toObject(message.landmarks[j], options); + } + if (message.rollAngle != null && message.hasOwnProperty("rollAngle")) + object.rollAngle = options.json && !isFinite(message.rollAngle) ? String(message.rollAngle) : message.rollAngle; + if (message.panAngle != null && message.hasOwnProperty("panAngle")) + object.panAngle = options.json && !isFinite(message.panAngle) ? String(message.panAngle) : message.panAngle; + if (message.tiltAngle != null && message.hasOwnProperty("tiltAngle")) + object.tiltAngle = options.json && !isFinite(message.tiltAngle) ? String(message.tiltAngle) : message.tiltAngle; + if (message.detectionConfidence != null && message.hasOwnProperty("detectionConfidence")) + object.detectionConfidence = options.json && !isFinite(message.detectionConfidence) ? String(message.detectionConfidence) : message.detectionConfidence; + if (message.landmarkingConfidence != null && message.hasOwnProperty("landmarkingConfidence")) + object.landmarkingConfidence = options.json && !isFinite(message.landmarkingConfidence) ? String(message.landmarkingConfidence) : message.landmarkingConfidence; + if (message.joyLikelihood != null && message.hasOwnProperty("joyLikelihood")) + object.joyLikelihood = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.joyLikelihood] : message.joyLikelihood; + if (message.sorrowLikelihood != null && message.hasOwnProperty("sorrowLikelihood")) + object.sorrowLikelihood = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.sorrowLikelihood] : message.sorrowLikelihood; + if (message.angerLikelihood != null && message.hasOwnProperty("angerLikelihood")) + object.angerLikelihood = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.angerLikelihood] : message.angerLikelihood; + if (message.surpriseLikelihood != null && message.hasOwnProperty("surpriseLikelihood")) + object.surpriseLikelihood = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.surpriseLikelihood] : message.surpriseLikelihood; + if (message.underExposedLikelihood != null && message.hasOwnProperty("underExposedLikelihood")) + object.underExposedLikelihood = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.underExposedLikelihood] : message.underExposedLikelihood; + if (message.blurredLikelihood != null && message.hasOwnProperty("blurredLikelihood")) + object.blurredLikelihood = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.blurredLikelihood] : message.blurredLikelihood; + if (message.headwearLikelihood != null && message.hasOwnProperty("headwearLikelihood")) + object.headwearLikelihood = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.headwearLikelihood] : message.headwearLikelihood; + return object; + }; + + /** + * Converts this FaceAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + FaceAnnotation.Landmark = (function() { + + /** + * Properties of a Landmark. + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @interface ILandmark + * @property {google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type|null} [type] Landmark type + * @property {google.cloud.vision.v1p4beta1.IPosition|null} [position] Landmark position + */ + + /** + * Constructs a new Landmark. + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation + * @classdesc Represents a Landmark. + * @implements ILandmark + * @constructor + * @param {google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + */ + function Landmark(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]]; + } + + /** + * Landmark type. + * @member {google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type} type + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.type = 0; + + /** + * Landmark position. + * @member {google.cloud.vision.v1p4beta1.IPosition|null|undefined} position + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @instance + */ + Landmark.prototype.position = null; + + /** + * Creates a new Landmark instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark} Landmark instance + */ + Landmark.create = function create(properties) { + return new Landmark(properties); + }; + + /** + * Encodes the specified Landmark message. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.position != null && message.hasOwnProperty("position")) + $root.google.cloud.vision.v1p4beta1.Position.encode(message.position, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Landmark message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p4beta1.FaceAnnotation.ILandmark} message Landmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Landmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Landmark message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.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.vision.v1p4beta1.FaceAnnotation.Landmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.type = reader.int32(); + break; + case 4: + message.position = $root.google.cloud.vision.v1p4beta1.Position.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Landmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark} Landmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Landmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Landmark message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Landmark.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + break; + } + if (message.position != null && message.hasOwnProperty("position")) { + var error = $root.google.cloud.vision.v1p4beta1.Position.verify(message.position); + if (error) + return "position." + error; + } + return null; + }; + + /** + * Creates a Landmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark} Landmark + */ + Landmark.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark(); + switch (object.type) { + case "UNKNOWN_LANDMARK": + case 0: + message.type = 0; + break; + case "LEFT_EYE": + case 1: + message.type = 1; + break; + case "RIGHT_EYE": + case 2: + message.type = 2; + break; + case "LEFT_OF_LEFT_EYEBROW": + case 3: + message.type = 3; + break; + case "RIGHT_OF_LEFT_EYEBROW": + case 4: + message.type = 4; + break; + case "LEFT_OF_RIGHT_EYEBROW": + case 5: + message.type = 5; + break; + case "RIGHT_OF_RIGHT_EYEBROW": + case 6: + message.type = 6; + break; + case "MIDPOINT_BETWEEN_EYES": + case 7: + message.type = 7; + break; + case "NOSE_TIP": + case 8: + message.type = 8; + break; + case "UPPER_LIP": + case 9: + message.type = 9; + break; + case "LOWER_LIP": + case 10: + message.type = 10; + break; + case "MOUTH_LEFT": + case 11: + message.type = 11; + break; + case "MOUTH_RIGHT": + case 12: + message.type = 12; + break; + case "MOUTH_CENTER": + case 13: + message.type = 13; + break; + case "NOSE_BOTTOM_RIGHT": + case 14: + message.type = 14; + break; + case "NOSE_BOTTOM_LEFT": + case 15: + message.type = 15; + break; + case "NOSE_BOTTOM_CENTER": + case 16: + message.type = 16; + break; + case "LEFT_EYE_TOP_BOUNDARY": + case 17: + message.type = 17; + break; + case "LEFT_EYE_RIGHT_CORNER": + case 18: + message.type = 18; + break; + case "LEFT_EYE_BOTTOM_BOUNDARY": + case 19: + message.type = 19; + break; + case "LEFT_EYE_LEFT_CORNER": + case 20: + message.type = 20; + break; + case "RIGHT_EYE_TOP_BOUNDARY": + case 21: + message.type = 21; + break; + case "RIGHT_EYE_RIGHT_CORNER": + case 22: + message.type = 22; + break; + case "RIGHT_EYE_BOTTOM_BOUNDARY": + case 23: + message.type = 23; + break; + case "RIGHT_EYE_LEFT_CORNER": + case 24: + message.type = 24; + break; + case "LEFT_EYEBROW_UPPER_MIDPOINT": + case 25: + message.type = 25; + break; + case "RIGHT_EYEBROW_UPPER_MIDPOINT": + case 26: + message.type = 26; + break; + case "LEFT_EAR_TRAGION": + case 27: + message.type = 27; + break; + case "RIGHT_EAR_TRAGION": + case 28: + message.type = 28; + break; + case "LEFT_EYE_PUPIL": + case 29: + message.type = 29; + break; + case "RIGHT_EYE_PUPIL": + case 30: + message.type = 30; + break; + case "FOREHEAD_GLABELLA": + case 31: + message.type = 31; + break; + case "CHIN_GNATHION": + case 32: + message.type = 32; + break; + case "CHIN_LEFT_GONION": + case 33: + message.type = 33; + break; + case "CHIN_RIGHT_GONION": + case 34: + message.type = 34; + break; + } + if (object.position != null) { + if (typeof object.position !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.position: object expected"); + message.position = $root.google.cloud.vision.v1p4beta1.Position.fromObject(object.position); + } + return message; + }; + + /** + * Creates a plain object from a Landmark message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @static + * @param {google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark} message Landmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Landmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN_LANDMARK" : 0; + object.position = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type[message.type] : message.type; + if (message.position != null && message.hasOwnProperty("position")) + object.position = $root.google.cloud.vision.v1p4beta1.Position.toObject(message.position, options); + return object; + }; + + /** + * Converts this Landmark to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark + * @instance + * @returns {Object.} JSON object + */ + Landmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type + * @enum {string} + * @property {number} UNKNOWN_LANDMARK=0 UNKNOWN_LANDMARK value + * @property {number} LEFT_EYE=1 LEFT_EYE value + * @property {number} RIGHT_EYE=2 RIGHT_EYE value + * @property {number} LEFT_OF_LEFT_EYEBROW=3 LEFT_OF_LEFT_EYEBROW value + * @property {number} RIGHT_OF_LEFT_EYEBROW=4 RIGHT_OF_LEFT_EYEBROW value + * @property {number} LEFT_OF_RIGHT_EYEBROW=5 LEFT_OF_RIGHT_EYEBROW value + * @property {number} RIGHT_OF_RIGHT_EYEBROW=6 RIGHT_OF_RIGHT_EYEBROW value + * @property {number} MIDPOINT_BETWEEN_EYES=7 MIDPOINT_BETWEEN_EYES value + * @property {number} NOSE_TIP=8 NOSE_TIP value + * @property {number} UPPER_LIP=9 UPPER_LIP value + * @property {number} LOWER_LIP=10 LOWER_LIP value + * @property {number} MOUTH_LEFT=11 MOUTH_LEFT value + * @property {number} MOUTH_RIGHT=12 MOUTH_RIGHT value + * @property {number} MOUTH_CENTER=13 MOUTH_CENTER value + * @property {number} NOSE_BOTTOM_RIGHT=14 NOSE_BOTTOM_RIGHT value + * @property {number} NOSE_BOTTOM_LEFT=15 NOSE_BOTTOM_LEFT value + * @property {number} NOSE_BOTTOM_CENTER=16 NOSE_BOTTOM_CENTER value + * @property {number} LEFT_EYE_TOP_BOUNDARY=17 LEFT_EYE_TOP_BOUNDARY value + * @property {number} LEFT_EYE_RIGHT_CORNER=18 LEFT_EYE_RIGHT_CORNER value + * @property {number} LEFT_EYE_BOTTOM_BOUNDARY=19 LEFT_EYE_BOTTOM_BOUNDARY value + * @property {number} LEFT_EYE_LEFT_CORNER=20 LEFT_EYE_LEFT_CORNER value + * @property {number} RIGHT_EYE_TOP_BOUNDARY=21 RIGHT_EYE_TOP_BOUNDARY value + * @property {number} RIGHT_EYE_RIGHT_CORNER=22 RIGHT_EYE_RIGHT_CORNER value + * @property {number} RIGHT_EYE_BOTTOM_BOUNDARY=23 RIGHT_EYE_BOTTOM_BOUNDARY value + * @property {number} RIGHT_EYE_LEFT_CORNER=24 RIGHT_EYE_LEFT_CORNER value + * @property {number} LEFT_EYEBROW_UPPER_MIDPOINT=25 LEFT_EYEBROW_UPPER_MIDPOINT value + * @property {number} RIGHT_EYEBROW_UPPER_MIDPOINT=26 RIGHT_EYEBROW_UPPER_MIDPOINT value + * @property {number} LEFT_EAR_TRAGION=27 LEFT_EAR_TRAGION value + * @property {number} RIGHT_EAR_TRAGION=28 RIGHT_EAR_TRAGION value + * @property {number} LEFT_EYE_PUPIL=29 LEFT_EYE_PUPIL value + * @property {number} RIGHT_EYE_PUPIL=30 RIGHT_EYE_PUPIL value + * @property {number} FOREHEAD_GLABELLA=31 FOREHEAD_GLABELLA value + * @property {number} CHIN_GNATHION=32 CHIN_GNATHION value + * @property {number} CHIN_LEFT_GONION=33 CHIN_LEFT_GONION value + * @property {number} CHIN_RIGHT_GONION=34 CHIN_RIGHT_GONION value + */ + Landmark.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_LANDMARK"] = 0; + values[valuesById[1] = "LEFT_EYE"] = 1; + values[valuesById[2] = "RIGHT_EYE"] = 2; + values[valuesById[3] = "LEFT_OF_LEFT_EYEBROW"] = 3; + values[valuesById[4] = "RIGHT_OF_LEFT_EYEBROW"] = 4; + values[valuesById[5] = "LEFT_OF_RIGHT_EYEBROW"] = 5; + values[valuesById[6] = "RIGHT_OF_RIGHT_EYEBROW"] = 6; + values[valuesById[7] = "MIDPOINT_BETWEEN_EYES"] = 7; + values[valuesById[8] = "NOSE_TIP"] = 8; + values[valuesById[9] = "UPPER_LIP"] = 9; + values[valuesById[10] = "LOWER_LIP"] = 10; + values[valuesById[11] = "MOUTH_LEFT"] = 11; + values[valuesById[12] = "MOUTH_RIGHT"] = 12; + values[valuesById[13] = "MOUTH_CENTER"] = 13; + values[valuesById[14] = "NOSE_BOTTOM_RIGHT"] = 14; + values[valuesById[15] = "NOSE_BOTTOM_LEFT"] = 15; + values[valuesById[16] = "NOSE_BOTTOM_CENTER"] = 16; + values[valuesById[17] = "LEFT_EYE_TOP_BOUNDARY"] = 17; + values[valuesById[18] = "LEFT_EYE_RIGHT_CORNER"] = 18; + values[valuesById[19] = "LEFT_EYE_BOTTOM_BOUNDARY"] = 19; + values[valuesById[20] = "LEFT_EYE_LEFT_CORNER"] = 20; + values[valuesById[21] = "RIGHT_EYE_TOP_BOUNDARY"] = 21; + values[valuesById[22] = "RIGHT_EYE_RIGHT_CORNER"] = 22; + values[valuesById[23] = "RIGHT_EYE_BOTTOM_BOUNDARY"] = 23; + values[valuesById[24] = "RIGHT_EYE_LEFT_CORNER"] = 24; + values[valuesById[25] = "LEFT_EYEBROW_UPPER_MIDPOINT"] = 25; + values[valuesById[26] = "RIGHT_EYEBROW_UPPER_MIDPOINT"] = 26; + values[valuesById[27] = "LEFT_EAR_TRAGION"] = 27; + values[valuesById[28] = "RIGHT_EAR_TRAGION"] = 28; + values[valuesById[29] = "LEFT_EYE_PUPIL"] = 29; + values[valuesById[30] = "RIGHT_EYE_PUPIL"] = 30; + values[valuesById[31] = "FOREHEAD_GLABELLA"] = 31; + values[valuesById[32] = "CHIN_GNATHION"] = 32; + values[valuesById[33] = "CHIN_LEFT_GONION"] = 33; + values[valuesById[34] = "CHIN_RIGHT_GONION"] = 34; + return values; + })(); + + return Landmark; + })(); + + return FaceAnnotation; + })(); + + v1p4beta1.LocationInfo = (function() { + + /** + * Properties of a LocationInfo. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ILocationInfo + * @property {google.type.ILatLng|null} [latLng] LocationInfo latLng + */ + + /** + * Constructs a new LocationInfo. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo + * @constructor + * @param {google.cloud.vision.v1p4beta1.ILocationInfo=} [properties] Properties to set + */ + function LocationInfo(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]]; + } + + /** + * LocationInfo latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @instance + */ + LocationInfo.prototype.latLng = null; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p4beta1.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.LocationInfo} LocationInfo instance + */ + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); + }; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p4beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && message.hasOwnProperty("latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p4beta1.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.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.vision.v1p4beta1.LocationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationInfo message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + return null; + }; + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.LocationInfo} LocationInfo + */ + LocationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.LocationInfo) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.LocationInfo(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.LocationInfo.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + return message; + }; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @static + * @param {google.cloud.vision.v1p4beta1.LocationInfo} message LocationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.latLng = null; + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + return object; + }; + + /** + * Converts this LocationInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.LocationInfo + * @instance + * @returns {Object.} JSON object + */ + LocationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationInfo; + })(); + + v1p4beta1.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [value] Property value + * @property {number|Long|null} [uint64Value] Property uint64Value + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.vision.v1p4beta1.IProperty=} [properties] Properties to set + */ + function Property(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]]; + } + + /** + * Property name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property value. + * @member {string} value + * @memberof google.cloud.vision.v1p4beta1.Property + * @instance + */ + Property.prototype.value = ""; + + /** + * Property uint64Value. + * @member {number|Long} uint64Value + * @memberof google.cloud.vision.v1p4beta1.Property + * @instance + */ + Property.prototype.uint64Value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {google.cloud.vision.v1p4beta1.IProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {google.cloud.vision.v1p4beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.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.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.uint64Value); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {google.cloud.vision.v1p4beta1.IProperty} message Property message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Property.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Property message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.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.vision.v1p4beta1.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.uint64Value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Property message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Property} Property + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Property.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Property message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Property.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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (!$util.isInteger(message.uint64Value) && !(message.uint64Value && $util.isInteger(message.uint64Value.low) && $util.isInteger(message.uint64Value.high))) + return "uint64Value: integer|Long expected"; + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Property) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.uint64Value != null) + if ($util.Long) + (message.uint64Value = $util.Long.fromValue(object.uint64Value)).unsigned = true; + else if (typeof object.uint64Value === "string") + message.uint64Value = parseInt(object.uint64Value, 10); + else if (typeof object.uint64Value === "number") + message.uint64Value = object.uint64Value; + else if (typeof object.uint64Value === "object") + message.uint64Value = new $util.LongBits(object.uint64Value.low >>> 0, object.uint64Value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Property + * @static + * @param {google.cloud.vision.v1p4beta1.Property} message Property + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Property.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.uint64Value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.uint64Value = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.uint64Value != null && message.hasOwnProperty("uint64Value")) + if (typeof message.uint64Value === "number") + object.uint64Value = options.longs === String ? String(message.uint64Value) : message.uint64Value; + else + object.uint64Value = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Value) : options.longs === Number ? new $util.LongBits(message.uint64Value.low >>> 0, message.uint64Value.high >>> 0).toNumber(true) : message.uint64Value; + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Property + * @instance + * @returns {Object.} JSON object + */ + Property.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Property; + })(); + + v1p4beta1.EntityAnnotation = (function() { + + /** + * Properties of an EntityAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IEntityAnnotation + * @property {string|null} [mid] EntityAnnotation mid + * @property {string|null} [locale] EntityAnnotation locale + * @property {string|null} [description] EntityAnnotation description + * @property {number|null} [score] EntityAnnotation score + * @property {number|null} [confidence] EntityAnnotation confidence + * @property {number|null} [topicality] EntityAnnotation topicality + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingPoly] EntityAnnotation boundingPoly + * @property {Array.|null} [locations] EntityAnnotation locations + * @property {Array.|null} [properties] EntityAnnotation properties + */ + + /** + * Constructs a new EntityAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an EntityAnnotation. + * @implements IEntityAnnotation + * @constructor + * @param {google.cloud.vision.v1p4beta1.IEntityAnnotation=} [properties] Properties to set + */ + function EntityAnnotation(properties) { + this.locations = []; + this.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]]; + } + + /** + * EntityAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.mid = ""; + + /** + * EntityAnnotation locale. + * @member {string} locale + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locale = ""; + + /** + * EntityAnnotation description. + * @member {string} description + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.description = ""; + + /** + * EntityAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.score = 0; + + /** + * EntityAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.confidence = 0; + + /** + * EntityAnnotation topicality. + * @member {number} topicality + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.topicality = 0; + + /** + * EntityAnnotation boundingPoly. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.boundingPoly = null; + + /** + * EntityAnnotation locations. + * @member {Array.} locations + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.locations = $util.emptyArray; + + /** + * EntityAnnotation properties. + * @member {Array.} properties + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + */ + EntityAnnotation.prototype.properties = $util.emptyArray; + + /** + * Creates a new EntityAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IEntityAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.EntityAnnotation} EntityAnnotation instance + */ + EntityAnnotation.create = function create(properties) { + return new EntityAnnotation(properties); + }; + + /** + * Encodes the specified EntityAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.EntityAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.locale != null && message.hasOwnProperty("locale")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.locale); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + if (message.topicality != null && message.hasOwnProperty("topicality")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicality); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.vision.v1p4beta1.LocationInfo.encode(message.locations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.vision.v1p4beta1.Property.encode(message.properties[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.EntityAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IEntityAnnotation} message EntityAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.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.vision.v1p4beta1.EntityAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.locale = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.confidence = reader.float(); + break; + case 6: + message.topicality = reader.float(); + break; + case 7: + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.vision.v1p4beta1.LocationInfo.decode(reader, reader.uint32())); + break; + case 9: + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.vision.v1p4beta1.Property.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.EntityAnnotation} EntityAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.locale != null && message.hasOwnProperty("locale")) + if (!$util.isString(message.locale)) + return "locale: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.topicality != null && message.hasOwnProperty("topicality")) + if (typeof message.topicality !== "number") + return "topicality: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.LocationInfo.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates an EntityAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.EntityAnnotation} EntityAnnotation + */ + EntityAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.EntityAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.EntityAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.locale != null) + message.locale = String(object.locale); + if (object.description != null) + message.description = String(object.description); + if (object.score != null) + message.score = Number(object.score); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.topicality != null) + message.topicality = Number(object.topicality); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.EntityAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.vision.v1p4beta1.EntityAnnotation.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.EntityAnnotation.locations: object expected"); + message.locations[i] = $root.google.cloud.vision.v1p4beta1.LocationInfo.fromObject(object.locations[i]); + } + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.vision.v1p4beta1.EntityAnnotation.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.EntityAnnotation.properties: object expected"); + message.properties[i] = $root.google.cloud.vision.v1p4beta1.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EntityAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.EntityAnnotation} message EntityAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locations = []; + object.properties = []; + } + if (options.defaults) { + object.mid = ""; + object.locale = ""; + object.description = ""; + object.score = 0; + object.confidence = 0; + object.topicality = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.locale != null && message.hasOwnProperty("locale")) + object.locale = message.locale; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.topicality != null && message.hasOwnProperty("topicality")) + object.topicality = options.json && !isFinite(message.topicality) ? String(message.topicality) : message.topicality; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.vision.v1p4beta1.LocationInfo.toObject(message.locations[j], options); + } + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.vision.v1p4beta1.Property.toObject(message.properties[j], options); + } + return object; + }; + + /** + * Converts this EntityAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.EntityAnnotation + * @instance + * @returns {Object.} JSON object + */ + EntityAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EntityAnnotation; + })(); + + v1p4beta1.LocalizedObjectAnnotation = (function() { + + /** + * Properties of a LocalizedObjectAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ILocalizedObjectAnnotation + * @property {string|null} [mid] LocalizedObjectAnnotation mid + * @property {string|null} [languageCode] LocalizedObjectAnnotation languageCode + * @property {string|null} [name] LocalizedObjectAnnotation name + * @property {number|null} [score] LocalizedObjectAnnotation score + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingPoly] LocalizedObjectAnnotation boundingPoly + */ + + /** + * Constructs a new LocalizedObjectAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a LocalizedObjectAnnotation. + * @implements ILocalizedObjectAnnotation + * @constructor + * @param {google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation=} [properties] Properties to set + */ + function LocalizedObjectAnnotation(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]]; + } + + /** + * LocalizedObjectAnnotation mid. + * @member {string} mid + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.mid = ""; + + /** + * LocalizedObjectAnnotation languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.languageCode = ""; + + /** + * LocalizedObjectAnnotation name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.name = ""; + + /** + * LocalizedObjectAnnotation score. + * @member {number} score + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.score = 0; + + /** + * LocalizedObjectAnnotation boundingPoly. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @instance + */ + LocalizedObjectAnnotation.prototype.boundingPoly = null; + + /** + * Creates a new LocalizedObjectAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation instance + */ + LocalizedObjectAnnotation.create = function create(properties) { + return new LocalizedObjectAnnotation(properties); + }; + + /** + * Encodes the specified LocalizedObjectAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation} message LocalizedObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedObjectAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mid != null && message.hasOwnProperty("mid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mid); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocalizedObjectAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ILocalizedObjectAnnotation} message LocalizedObjectAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedObjectAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedObjectAnnotation.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.vision.v1p4beta1.LocalizedObjectAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mid = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.score = reader.float(); + break; + case 5: + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalizedObjectAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedObjectAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalizedObjectAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalizedObjectAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mid != null && message.hasOwnProperty("mid")) + if (!$util.isString(message.mid)) + return "mid: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + return null; + }; + + /** + * Creates a LocalizedObjectAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation} LocalizedObjectAnnotation + */ + LocalizedObjectAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation(); + if (object.mid != null) + message.mid = String(object.mid); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.name != null) + message.name = String(object.name); + if (object.score != null) + message.score = Number(object.score); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingPoly); + } + return message; + }; + + /** + * Creates a plain object from a LocalizedObjectAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation} message LocalizedObjectAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalizedObjectAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mid = ""; + object.languageCode = ""; + object.name = ""; + object.score = 0; + object.boundingPoly = null; + } + if (message.mid != null && message.hasOwnProperty("mid")) + object.mid = message.mid; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingPoly, options); + return object; + }; + + /** + * Converts this LocalizedObjectAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation + * @instance + * @returns {Object.} JSON object + */ + LocalizedObjectAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocalizedObjectAnnotation; + })(); + + v1p4beta1.SafeSearchAnnotation = (function() { + + /** + * Properties of a SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ISafeSearchAnnotation + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [adult] SafeSearchAnnotation adult + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [spoof] SafeSearchAnnotation spoof + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [medical] SafeSearchAnnotation medical + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [violence] SafeSearchAnnotation violence + * @property {google.cloud.vision.v1p4beta1.Likelihood|null} [racy] SafeSearchAnnotation racy + */ + + /** + * Constructs a new SafeSearchAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a SafeSearchAnnotation. + * @implements ISafeSearchAnnotation + * @constructor + * @param {google.cloud.vision.v1p4beta1.ISafeSearchAnnotation=} [properties] Properties to set + */ + function SafeSearchAnnotation(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]]; + } + + /** + * SafeSearchAnnotation adult. + * @member {google.cloud.vision.v1p4beta1.Likelihood} adult + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.adult = 0; + + /** + * SafeSearchAnnotation spoof. + * @member {google.cloud.vision.v1p4beta1.Likelihood} spoof + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.spoof = 0; + + /** + * SafeSearchAnnotation medical. + * @member {google.cloud.vision.v1p4beta1.Likelihood} medical + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.medical = 0; + + /** + * SafeSearchAnnotation violence. + * @member {google.cloud.vision.v1p4beta1.Likelihood} violence + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.violence = 0; + + /** + * SafeSearchAnnotation racy. + * @member {google.cloud.vision.v1p4beta1.Likelihood} racy + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @instance + */ + SafeSearchAnnotation.prototype.racy = 0; + + /** + * Creates a new SafeSearchAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ISafeSearchAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.SafeSearchAnnotation} SafeSearchAnnotation instance + */ + SafeSearchAnnotation.create = function create(properties) { + return new SafeSearchAnnotation(properties); + }; + + /** + * Encodes the specified SafeSearchAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adult != null && message.hasOwnProperty("adult")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.adult); + if (message.spoof != null && message.hasOwnProperty("spoof")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.spoof); + if (message.medical != null && message.hasOwnProperty("medical")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.medical); + if (message.violence != null && message.hasOwnProperty("violence")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.violence); + if (message.racy != null && message.hasOwnProperty("racy")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.racy); + return writer; + }; + + /** + * Encodes the specified SafeSearchAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.SafeSearchAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ISafeSearchAnnotation} message SafeSearchAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafeSearchAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.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.vision.v1p4beta1.SafeSearchAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.adult = reader.int32(); + break; + case 2: + message.spoof = reader.int32(); + break; + case 3: + message.medical = reader.int32(); + break; + case 4: + message.violence = reader.int32(); + break; + case 9: + message.racy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafeSearchAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.SafeSearchAnnotation} SafeSearchAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafeSearchAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafeSearchAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafeSearchAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adult != null && message.hasOwnProperty("adult")) + switch (message.adult) { + default: + return "adult: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.spoof != null && message.hasOwnProperty("spoof")) + switch (message.spoof) { + default: + return "spoof: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.medical != null && message.hasOwnProperty("medical")) + switch (message.medical) { + default: + return "medical: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.violence != null && message.hasOwnProperty("violence")) + switch (message.violence) { + default: + return "violence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.racy != null && message.hasOwnProperty("racy")) + switch (message.racy) { + default: + return "racy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafeSearchAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.SafeSearchAnnotation} SafeSearchAnnotation + */ + SafeSearchAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.SafeSearchAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.SafeSearchAnnotation(); + switch (object.adult) { + case "UNKNOWN": + case 0: + message.adult = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.adult = 1; + break; + case "UNLIKELY": + case 2: + message.adult = 2; + break; + case "POSSIBLE": + case 3: + message.adult = 3; + break; + case "LIKELY": + case 4: + message.adult = 4; + break; + case "VERY_LIKELY": + case 5: + message.adult = 5; + break; + } + switch (object.spoof) { + case "UNKNOWN": + case 0: + message.spoof = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.spoof = 1; + break; + case "UNLIKELY": + case 2: + message.spoof = 2; + break; + case "POSSIBLE": + case 3: + message.spoof = 3; + break; + case "LIKELY": + case 4: + message.spoof = 4; + break; + case "VERY_LIKELY": + case 5: + message.spoof = 5; + break; + } + switch (object.medical) { + case "UNKNOWN": + case 0: + message.medical = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.medical = 1; + break; + case "UNLIKELY": + case 2: + message.medical = 2; + break; + case "POSSIBLE": + case 3: + message.medical = 3; + break; + case "LIKELY": + case 4: + message.medical = 4; + break; + case "VERY_LIKELY": + case 5: + message.medical = 5; + break; + } + switch (object.violence) { + case "UNKNOWN": + case 0: + message.violence = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.violence = 1; + break; + case "UNLIKELY": + case 2: + message.violence = 2; + break; + case "POSSIBLE": + case 3: + message.violence = 3; + break; + case "LIKELY": + case 4: + message.violence = 4; + break; + case "VERY_LIKELY": + case 5: + message.violence = 5; + break; + } + switch (object.racy) { + case "UNKNOWN": + case 0: + message.racy = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.racy = 1; + break; + case "UNLIKELY": + case 2: + message.racy = 2; + break; + case "POSSIBLE": + case 3: + message.racy = 3; + break; + case "LIKELY": + case 4: + message.racy = 4; + break; + case "VERY_LIKELY": + case 5: + message.racy = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafeSearchAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.SafeSearchAnnotation} message SafeSearchAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafeSearchAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adult = options.enums === String ? "UNKNOWN" : 0; + object.spoof = options.enums === String ? "UNKNOWN" : 0; + object.medical = options.enums === String ? "UNKNOWN" : 0; + object.violence = options.enums === String ? "UNKNOWN" : 0; + object.racy = options.enums === String ? "UNKNOWN" : 0; + } + if (message.adult != null && message.hasOwnProperty("adult")) + object.adult = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.adult] : message.adult; + if (message.spoof != null && message.hasOwnProperty("spoof")) + object.spoof = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.spoof] : message.spoof; + if (message.medical != null && message.hasOwnProperty("medical")) + object.medical = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.medical] : message.medical; + if (message.violence != null && message.hasOwnProperty("violence")) + object.violence = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.violence] : message.violence; + if (message.racy != null && message.hasOwnProperty("racy")) + object.racy = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Likelihood[message.racy] : message.racy; + return object; + }; + + /** + * Converts this SafeSearchAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.SafeSearchAnnotation + * @instance + * @returns {Object.} JSON object + */ + SafeSearchAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SafeSearchAnnotation; + })(); + + v1p4beta1.LatLongRect = (function() { + + /** + * Properties of a LatLongRect. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ILatLongRect + * @property {google.type.ILatLng|null} [minLatLng] LatLongRect minLatLng + * @property {google.type.ILatLng|null} [maxLatLng] LatLongRect maxLatLng + */ + + /** + * Constructs a new LatLongRect. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a LatLongRect. + * @implements ILatLongRect + * @constructor + * @param {google.cloud.vision.v1p4beta1.ILatLongRect=} [properties] Properties to set + */ + function LatLongRect(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]]; + } + + /** + * LatLongRect minLatLng. + * @member {google.type.ILatLng|null|undefined} minLatLng + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.minLatLng = null; + + /** + * LatLongRect maxLatLng. + * @member {google.type.ILatLng|null|undefined} maxLatLng + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @instance + */ + LatLongRect.prototype.maxLatLng = null; + + /** + * Creates a new LatLongRect instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p4beta1.ILatLongRect=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.LatLongRect} LatLongRect instance + */ + LatLongRect.create = function create(properties) { + return new LatLongRect(properties); + }; + + /** + * Encodes the specified LatLongRect message. Does not implicitly {@link google.cloud.vision.v1p4beta1.LatLongRect.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p4beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + $root.google.type.LatLng.encode(message.minLatLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + $root.google.type.LatLng.encode(message.maxLatLng, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LatLongRect message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.LatLongRect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p4beta1.ILatLongRect} message LatLongRect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLongRect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.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.vision.v1p4beta1.LatLongRect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 2: + message.maxLatLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLongRect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.LatLongRect} LatLongRect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLongRect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLongRect message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLongRect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) { + var error = $root.google.type.LatLng.verify(message.minLatLng); + if (error) + return "minLatLng." + error; + } + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) { + var error = $root.google.type.LatLng.verify(message.maxLatLng); + if (error) + return "maxLatLng." + error; + } + return null; + }; + + /** + * Creates a LatLongRect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.LatLongRect} LatLongRect + */ + LatLongRect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.LatLongRect) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.LatLongRect(); + if (object.minLatLng != null) { + if (typeof object.minLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.LatLongRect.minLatLng: object expected"); + message.minLatLng = $root.google.type.LatLng.fromObject(object.minLatLng); + } + if (object.maxLatLng != null) { + if (typeof object.maxLatLng !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.LatLongRect.maxLatLng: object expected"); + message.maxLatLng = $root.google.type.LatLng.fromObject(object.maxLatLng); + } + return message; + }; + + /** + * Creates a plain object from a LatLongRect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @static + * @param {google.cloud.vision.v1p4beta1.LatLongRect} message LatLongRect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLongRect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minLatLng = null; + object.maxLatLng = null; + } + if (message.minLatLng != null && message.hasOwnProperty("minLatLng")) + object.minLatLng = $root.google.type.LatLng.toObject(message.minLatLng, options); + if (message.maxLatLng != null && message.hasOwnProperty("maxLatLng")) + object.maxLatLng = $root.google.type.LatLng.toObject(message.maxLatLng, options); + return object; + }; + + /** + * Converts this LatLongRect to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.LatLongRect + * @instance + * @returns {Object.} JSON object + */ + LatLongRect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LatLongRect; + })(); + + v1p4beta1.ColorInfo = (function() { + + /** + * Properties of a ColorInfo. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IColorInfo + * @property {google.type.IColor|null} [color] ColorInfo color + * @property {number|null} [score] ColorInfo score + * @property {number|null} [pixelFraction] ColorInfo pixelFraction + */ + + /** + * Constructs a new ColorInfo. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ColorInfo. + * @implements IColorInfo + * @constructor + * @param {google.cloud.vision.v1p4beta1.IColorInfo=} [properties] Properties to set + */ + function ColorInfo(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]]; + } + + /** + * ColorInfo color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.color = null; + + /** + * ColorInfo score. + * @member {number} score + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.score = 0; + + /** + * ColorInfo pixelFraction. + * @member {number} pixelFraction + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @instance + */ + ColorInfo.prototype.pixelFraction = 0; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p4beta1.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ColorInfo} ColorInfo instance + */ + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); + }; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ColorInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p4beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.color != null && message.hasOwnProperty("color")) + $root.google.type.Color.encode(message.color, 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); + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.pixelFraction); + return writer; + }; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ColorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p4beta1.IColorInfo} message ColorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.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.vision.v1p4beta1.ColorInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.color = $root.google.type.Color.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pixelFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ColorInfo} ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColorInfo message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.color != null && message.hasOwnProperty("color")) { + var error = $root.google.type.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + if (typeof message.pixelFraction !== "number") + return "pixelFraction: number expected"; + return null; + }; + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ColorInfo} ColorInfo + */ + ColorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ColorInfo) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ColorInfo(); + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ColorInfo.color: object expected"); + message.color = $root.google.type.Color.fromObject(object.color); + } + if (object.score != null) + message.score = Number(object.score); + if (object.pixelFraction != null) + message.pixelFraction = Number(object.pixelFraction); + return message; + }; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @static + * @param {google.cloud.vision.v1p4beta1.ColorInfo} message ColorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.color = null; + object.score = 0; + object.pixelFraction = 0; + } + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.type.Color.toObject(message.color, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pixelFraction != null && message.hasOwnProperty("pixelFraction")) + object.pixelFraction = options.json && !isFinite(message.pixelFraction) ? String(message.pixelFraction) : message.pixelFraction; + return object; + }; + + /** + * Converts this ColorInfo to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ColorInfo + * @instance + * @returns {Object.} JSON object + */ + ColorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ColorInfo; + })(); + + v1p4beta1.DominantColorsAnnotation = (function() { + + /** + * Properties of a DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IDominantColorsAnnotation + * @property {Array.|null} [colors] DominantColorsAnnotation colors + */ + + /** + * Constructs a new DominantColorsAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a DominantColorsAnnotation. + * @implements IDominantColorsAnnotation + * @constructor + * @param {google.cloud.vision.v1p4beta1.IDominantColorsAnnotation=} [properties] Properties to set + */ + function DominantColorsAnnotation(properties) { + this.colors = []; + 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]]; + } + + /** + * DominantColorsAnnotation colors. + * @member {Array.} colors + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @instance + */ + DominantColorsAnnotation.prototype.colors = $util.emptyArray; + + /** + * Creates a new DominantColorsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IDominantColorsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.DominantColorsAnnotation} DominantColorsAnnotation instance + */ + DominantColorsAnnotation.create = function create(properties) { + return new DominantColorsAnnotation(properties); + }; + + /** + * Encodes the specified DominantColorsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.colors != null && message.colors.length) + for (var i = 0; i < message.colors.length; ++i) + $root.google.cloud.vision.v1p4beta1.ColorInfo.encode(message.colors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DominantColorsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DominantColorsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.IDominantColorsAnnotation} message DominantColorsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DominantColorsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.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.vision.v1p4beta1.DominantColorsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.colors && message.colors.length)) + message.colors = []; + message.colors.push($root.google.cloud.vision.v1p4beta1.ColorInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DominantColorsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.DominantColorsAnnotation} DominantColorsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DominantColorsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DominantColorsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DominantColorsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.colors != null && message.hasOwnProperty("colors")) { + if (!Array.isArray(message.colors)) + return "colors: array expected"; + for (var i = 0; i < message.colors.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.ColorInfo.verify(message.colors[i]); + if (error) + return "colors." + error; + } + } + return null; + }; + + /** + * Creates a DominantColorsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.DominantColorsAnnotation} DominantColorsAnnotation + */ + DominantColorsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.DominantColorsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.DominantColorsAnnotation(); + if (object.colors) { + if (!Array.isArray(object.colors)) + throw TypeError(".google.cloud.vision.v1p4beta1.DominantColorsAnnotation.colors: array expected"); + message.colors = []; + for (var i = 0; i < object.colors.length; ++i) { + if (typeof object.colors[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.DominantColorsAnnotation.colors: object expected"); + message.colors[i] = $root.google.cloud.vision.v1p4beta1.ColorInfo.fromObject(object.colors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DominantColorsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.DominantColorsAnnotation} message DominantColorsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DominantColorsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.colors = []; + if (message.colors && message.colors.length) { + object.colors = []; + for (var j = 0; j < message.colors.length; ++j) + object.colors[j] = $root.google.cloud.vision.v1p4beta1.ColorInfo.toObject(message.colors[j], options); + } + return object; + }; + + /** + * Converts this DominantColorsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.DominantColorsAnnotation + * @instance + * @returns {Object.} JSON object + */ + DominantColorsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DominantColorsAnnotation; + })(); + + v1p4beta1.ImageProperties = (function() { + + /** + * Properties of an ImageProperties. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImageProperties + * @property {google.cloud.vision.v1p4beta1.IDominantColorsAnnotation|null} [dominantColors] ImageProperties dominantColors + */ + + /** + * Constructs a new ImageProperties. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImageProperties. + * @implements IImageProperties + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImageProperties=} [properties] Properties to set + */ + function ImageProperties(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]]; + } + + /** + * ImageProperties dominantColors. + * @member {google.cloud.vision.v1p4beta1.IDominantColorsAnnotation|null|undefined} dominantColors + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @instance + */ + ImageProperties.prototype.dominantColors = null; + + /** + * Creates a new ImageProperties instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p4beta1.IImageProperties=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImageProperties} ImageProperties instance + */ + ImageProperties.create = function create(properties) { + return new ImageProperties(properties); + }; + + /** + * Encodes the specified ImageProperties message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p4beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + $root.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.encode(message.dominantColors, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageProperties message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p4beta1.IImageProperties} message ImageProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.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.vision.v1p4beta1.ImageProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dominantColors = $root.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImageProperties} ImageProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageProperties message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) { + var error = $root.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.verify(message.dominantColors); + if (error) + return "dominantColors." + error; + } + return null; + }; + + /** + * Creates an ImageProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImageProperties} ImageProperties + */ + ImageProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImageProperties) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImageProperties(); + if (object.dominantColors != null) { + if (typeof object.dominantColors !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImageProperties.dominantColors: object expected"); + message.dominantColors = $root.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.fromObject(object.dominantColors); + } + return message; + }; + + /** + * Creates a plain object from an ImageProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @static + * @param {google.cloud.vision.v1p4beta1.ImageProperties} message ImageProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dominantColors = null; + if (message.dominantColors != null && message.hasOwnProperty("dominantColors")) + object.dominantColors = $root.google.cloud.vision.v1p4beta1.DominantColorsAnnotation.toObject(message.dominantColors, options); + return object; + }; + + /** + * Converts this ImageProperties to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImageProperties + * @instance + * @returns {Object.} JSON object + */ + ImageProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageProperties; + })(); + + v1p4beta1.CropHint = (function() { + + /** + * Properties of a CropHint. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ICropHint + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingPoly] CropHint boundingPoly + * @property {number|null} [confidence] CropHint confidence + * @property {number|null} [importanceFraction] CropHint importanceFraction + */ + + /** + * Constructs a new CropHint. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a CropHint. + * @implements ICropHint + * @constructor + * @param {google.cloud.vision.v1p4beta1.ICropHint=} [properties] Properties to set + */ + function CropHint(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]]; + } + + /** + * CropHint boundingPoly. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @instance + */ + CropHint.prototype.boundingPoly = null; + + /** + * CropHint confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @instance + */ + CropHint.prototype.confidence = 0; + + /** + * CropHint importanceFraction. + * @member {number} importanceFraction + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @instance + */ + CropHint.prototype.importanceFraction = 0; + + /** + * Creates a new CropHint instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHint=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.CropHint} CropHint instance + */ + CropHint.create = function create(properties) { + return new CropHint(properties); + }; + + /** + * Encodes the specified CropHint message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHint.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.importanceFraction); + return writer; + }; + + /** + * Encodes the specified CropHint message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHint} message CropHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.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.vision.v1p4beta1.CropHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.importanceFraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.CropHint} CropHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHint message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + if (typeof message.importanceFraction !== "number") + return "importanceFraction: number expected"; + return null; + }; + + /** + * Creates a CropHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.CropHint} CropHint + */ + CropHint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.CropHint) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.CropHint(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.CropHint.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.importanceFraction != null) + message.importanceFraction = Number(object.importanceFraction); + return message; + }; + + /** + * Creates a plain object from a CropHint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @static + * @param {google.cloud.vision.v1p4beta1.CropHint} message CropHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingPoly = null; + object.confidence = 0; + object.importanceFraction = 0; + } + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.importanceFraction != null && message.hasOwnProperty("importanceFraction")) + object.importanceFraction = options.json && !isFinite(message.importanceFraction) ? String(message.importanceFraction) : message.importanceFraction; + return object; + }; + + /** + * Converts this CropHint to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.CropHint + * @instance + * @returns {Object.} JSON object + */ + CropHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHint; + })(); + + v1p4beta1.CropHintsAnnotation = (function() { + + /** + * Properties of a CropHintsAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ICropHintsAnnotation + * @property {Array.|null} [cropHints] CropHintsAnnotation cropHints + */ + + /** + * Constructs a new CropHintsAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a CropHintsAnnotation. + * @implements ICropHintsAnnotation + * @constructor + * @param {google.cloud.vision.v1p4beta1.ICropHintsAnnotation=} [properties] Properties to set + */ + function CropHintsAnnotation(properties) { + this.cropHints = []; + 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]]; + } + + /** + * CropHintsAnnotation cropHints. + * @member {Array.} cropHints + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @instance + */ + CropHintsAnnotation.prototype.cropHints = $util.emptyArray; + + /** + * Creates a new CropHintsAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHintsAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.CropHintsAnnotation} CropHintsAnnotation instance + */ + CropHintsAnnotation.create = function create(properties) { + return new CropHintsAnnotation(properties); + }; + + /** + * Encodes the specified CropHintsAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cropHints != null && message.cropHints.length) + for (var i = 0; i < message.cropHints.length; ++i) + $root.google.cloud.vision.v1p4beta1.CropHint.encode(message.cropHints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CropHintsAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHintsAnnotation} message CropHintsAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.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.vision.v1p4beta1.CropHintsAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cropHints && message.cropHints.length)) + message.cropHints = []; + message.cropHints.push($root.google.cloud.vision.v1p4beta1.CropHint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.CropHintsAnnotation} CropHintsAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cropHints != null && message.hasOwnProperty("cropHints")) { + if (!Array.isArray(message.cropHints)) + return "cropHints: array expected"; + for (var i = 0; i < message.cropHints.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.CropHint.verify(message.cropHints[i]); + if (error) + return "cropHints." + error; + } + } + return null; + }; + + /** + * Creates a CropHintsAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.CropHintsAnnotation} CropHintsAnnotation + */ + CropHintsAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.CropHintsAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.CropHintsAnnotation(); + if (object.cropHints) { + if (!Array.isArray(object.cropHints)) + throw TypeError(".google.cloud.vision.v1p4beta1.CropHintsAnnotation.cropHints: array expected"); + message.cropHints = []; + for (var i = 0; i < object.cropHints.length; ++i) { + if (typeof object.cropHints[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.CropHintsAnnotation.cropHints: object expected"); + message.cropHints[i] = $root.google.cloud.vision.v1p4beta1.CropHint.fromObject(object.cropHints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CropHintsAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.CropHintsAnnotation} message CropHintsAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cropHints = []; + if (message.cropHints && message.cropHints.length) { + object.cropHints = []; + for (var j = 0; j < message.cropHints.length; ++j) + object.cropHints[j] = $root.google.cloud.vision.v1p4beta1.CropHint.toObject(message.cropHints[j], options); + } + return object; + }; + + /** + * Converts this CropHintsAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.CropHintsAnnotation + * @instance + * @returns {Object.} JSON object + */ + CropHintsAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsAnnotation; + })(); + + v1p4beta1.CropHintsParams = (function() { + + /** + * Properties of a CropHintsParams. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ICropHintsParams + * @property {Array.|null} [aspectRatios] CropHintsParams aspectRatios + */ + + /** + * Constructs a new CropHintsParams. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a CropHintsParams. + * @implements ICropHintsParams + * @constructor + * @param {google.cloud.vision.v1p4beta1.ICropHintsParams=} [properties] Properties to set + */ + function CropHintsParams(properties) { + this.aspectRatios = []; + 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]]; + } + + /** + * CropHintsParams aspectRatios. + * @member {Array.} aspectRatios + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @instance + */ + CropHintsParams.prototype.aspectRatios = $util.emptyArray; + + /** + * Creates a new CropHintsParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHintsParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.CropHintsParams} CropHintsParams instance + */ + CropHintsParams.create = function create(properties) { + return new CropHintsParams(properties); + }; + + /** + * Encodes the specified CropHintsParams message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aspectRatios != null && message.aspectRatios.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.aspectRatios.length; ++i) + writer.float(message.aspectRatios[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CropHintsParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CropHintsParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p4beta1.ICropHintsParams} message CropHintsParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CropHintsParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.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.vision.v1p4beta1.CropHintsParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.aspectRatios && message.aspectRatios.length)) + message.aspectRatios = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.aspectRatios.push(reader.float()); + } else + message.aspectRatios.push(reader.float()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CropHintsParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.CropHintsParams} CropHintsParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CropHintsParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CropHintsParams message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CropHintsParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aspectRatios != null && message.hasOwnProperty("aspectRatios")) { + if (!Array.isArray(message.aspectRatios)) + return "aspectRatios: array expected"; + for (var i = 0; i < message.aspectRatios.length; ++i) + if (typeof message.aspectRatios[i] !== "number") + return "aspectRatios: number[] expected"; + } + return null; + }; + + /** + * Creates a CropHintsParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.CropHintsParams} CropHintsParams + */ + CropHintsParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.CropHintsParams) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.CropHintsParams(); + if (object.aspectRatios) { + if (!Array.isArray(object.aspectRatios)) + throw TypeError(".google.cloud.vision.v1p4beta1.CropHintsParams.aspectRatios: array expected"); + message.aspectRatios = []; + for (var i = 0; i < object.aspectRatios.length; ++i) + message.aspectRatios[i] = Number(object.aspectRatios[i]); + } + return message; + }; + + /** + * Creates a plain object from a CropHintsParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @static + * @param {google.cloud.vision.v1p4beta1.CropHintsParams} message CropHintsParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CropHintsParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aspectRatios = []; + if (message.aspectRatios && message.aspectRatios.length) { + object.aspectRatios = []; + for (var j = 0; j < message.aspectRatios.length; ++j) + object.aspectRatios[j] = options.json && !isFinite(message.aspectRatios[j]) ? String(message.aspectRatios[j]) : message.aspectRatios[j]; + } + return object; + }; + + /** + * Converts this CropHintsParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.CropHintsParams + * @instance + * @returns {Object.} JSON object + */ + CropHintsParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CropHintsParams; + })(); + + v1p4beta1.WebDetectionParams = (function() { + + /** + * Properties of a WebDetectionParams. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IWebDetectionParams + * @property {boolean|null} [includeGeoResults] WebDetectionParams includeGeoResults + */ + + /** + * Constructs a new WebDetectionParams. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a WebDetectionParams. + * @implements IWebDetectionParams + * @constructor + * @param {google.cloud.vision.v1p4beta1.IWebDetectionParams=} [properties] Properties to set + */ + function WebDetectionParams(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]]; + } + + /** + * WebDetectionParams includeGeoResults. + * @member {boolean} includeGeoResults + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @instance + */ + WebDetectionParams.prototype.includeGeoResults = false; + + /** + * Creates a new WebDetectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p4beta1.IWebDetectionParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.WebDetectionParams} WebDetectionParams instance + */ + WebDetectionParams.create = function create(properties) { + return new WebDetectionParams(properties); + }; + + /** + * Encodes the specified WebDetectionParams message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p4beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeGeoResults); + return writer; + }; + + /** + * Encodes the specified WebDetectionParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p4beta1.IWebDetectionParams} message WebDetectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.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.vision.v1p4beta1.WebDetectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.includeGeoResults = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.WebDetectionParams} WebDetectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetectionParams message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetectionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + if (typeof message.includeGeoResults !== "boolean") + return "includeGeoResults: boolean expected"; + return null; + }; + + /** + * Creates a WebDetectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.WebDetectionParams} WebDetectionParams + */ + WebDetectionParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.WebDetectionParams) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.WebDetectionParams(); + if (object.includeGeoResults != null) + message.includeGeoResults = Boolean(object.includeGeoResults); + return message; + }; + + /** + * Creates a plain object from a WebDetectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetectionParams} message WebDetectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.includeGeoResults = false; + if (message.includeGeoResults != null && message.hasOwnProperty("includeGeoResults")) + object.includeGeoResults = message.includeGeoResults; + return object; + }; + + /** + * Converts this WebDetectionParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.WebDetectionParams + * @instance + * @returns {Object.} JSON object + */ + WebDetectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebDetectionParams; + })(); + + v1p4beta1.ImageContext = (function() { + + /** + * Properties of an ImageContext. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImageContext + * @property {google.cloud.vision.v1p4beta1.ILatLongRect|null} [latLongRect] ImageContext latLongRect + * @property {Array.|null} [languageHints] ImageContext languageHints + * @property {google.cloud.vision.v1p4beta1.ICropHintsParams|null} [cropHintsParams] ImageContext cropHintsParams + * @property {google.cloud.vision.v1p4beta1.IProductSearchParams|null} [productSearchParams] ImageContext productSearchParams + * @property {google.cloud.vision.v1p4beta1.IWebDetectionParams|null} [webDetectionParams] ImageContext webDetectionParams + */ + + /** + * Constructs a new ImageContext. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImageContext. + * @implements IImageContext + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImageContext=} [properties] Properties to set + */ + function ImageContext(properties) { + this.languageHints = []; + 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]]; + } + + /** + * ImageContext latLongRect. + * @member {google.cloud.vision.v1p4beta1.ILatLongRect|null|undefined} latLongRect + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @instance + */ + ImageContext.prototype.latLongRect = null; + + /** + * ImageContext languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @instance + */ + ImageContext.prototype.languageHints = $util.emptyArray; + + /** + * ImageContext cropHintsParams. + * @member {google.cloud.vision.v1p4beta1.ICropHintsParams|null|undefined} cropHintsParams + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @instance + */ + ImageContext.prototype.cropHintsParams = null; + + /** + * ImageContext productSearchParams. + * @member {google.cloud.vision.v1p4beta1.IProductSearchParams|null|undefined} productSearchParams + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @instance + */ + ImageContext.prototype.productSearchParams = null; + + /** + * ImageContext webDetectionParams. + * @member {google.cloud.vision.v1p4beta1.IWebDetectionParams|null|undefined} webDetectionParams + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @instance + */ + ImageContext.prototype.webDetectionParams = null; + + /** + * Creates a new ImageContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p4beta1.IImageContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImageContext} ImageContext instance + */ + ImageContext.create = function create(properties) { + return new ImageContext(properties); + }; + + /** + * Encodes the specified ImageContext message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p4beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + $root.google.cloud.vision.v1p4beta1.LatLongRect.encode(message.latLongRect, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageHints[i]); + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + $root.google.cloud.vision.v1p4beta1.CropHintsParams.encode(message.cropHintsParams, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) + $root.google.cloud.vision.v1p4beta1.ProductSearchParams.encode(message.productSearchParams, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + $root.google.cloud.vision.v1p4beta1.WebDetectionParams.encode(message.webDetectionParams, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p4beta1.IImageContext} message ImageContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.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.vision.v1p4beta1.ImageContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latLongRect = $root.google.cloud.vision.v1p4beta1.LatLongRect.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + case 4: + message.cropHintsParams = $root.google.cloud.vision.v1p4beta1.CropHintsParams.decode(reader, reader.uint32()); + break; + case 5: + message.productSearchParams = $root.google.cloud.vision.v1p4beta1.ProductSearchParams.decode(reader, reader.uint32()); + break; + case 6: + message.webDetectionParams = $root.google.cloud.vision.v1p4beta1.WebDetectionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImageContext} ImageContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageContext message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) { + var error = $root.google.cloud.vision.v1p4beta1.LatLongRect.verify(message.latLongRect); + if (error) + return "latLongRect." + error; + } + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) { + var error = $root.google.cloud.vision.v1p4beta1.CropHintsParams.verify(message.cropHintsParams); + if (error) + return "cropHintsParams." + error; + } + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSearchParams.verify(message.productSearchParams); + if (error) + return "productSearchParams." + error; + } + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetectionParams.verify(message.webDetectionParams); + if (error) + return "webDetectionParams." + error; + } + return null; + }; + + /** + * Creates an ImageContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImageContext} ImageContext + */ + ImageContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImageContext) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImageContext(); + if (object.latLongRect != null) { + if (typeof object.latLongRect !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImageContext.latLongRect: object expected"); + message.latLongRect = $root.google.cloud.vision.v1p4beta1.LatLongRect.fromObject(object.latLongRect); + } + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.vision.v1p4beta1.ImageContext.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + if (object.cropHintsParams != null) { + if (typeof object.cropHintsParams !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImageContext.cropHintsParams: object expected"); + message.cropHintsParams = $root.google.cloud.vision.v1p4beta1.CropHintsParams.fromObject(object.cropHintsParams); + } + if (object.productSearchParams != null) { + if (typeof object.productSearchParams !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImageContext.productSearchParams: object expected"); + message.productSearchParams = $root.google.cloud.vision.v1p4beta1.ProductSearchParams.fromObject(object.productSearchParams); + } + if (object.webDetectionParams != null) { + if (typeof object.webDetectionParams !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImageContext.webDetectionParams: object expected"); + message.webDetectionParams = $root.google.cloud.vision.v1p4beta1.WebDetectionParams.fromObject(object.webDetectionParams); + } + return message; + }; + + /** + * Creates a plain object from an ImageContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @static + * @param {google.cloud.vision.v1p4beta1.ImageContext} message ImageContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (options.defaults) { + object.latLongRect = null; + object.cropHintsParams = null; + object.productSearchParams = null; + object.webDetectionParams = null; + } + if (message.latLongRect != null && message.hasOwnProperty("latLongRect")) + object.latLongRect = $root.google.cloud.vision.v1p4beta1.LatLongRect.toObject(message.latLongRect, options); + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + if (message.cropHintsParams != null && message.hasOwnProperty("cropHintsParams")) + object.cropHintsParams = $root.google.cloud.vision.v1p4beta1.CropHintsParams.toObject(message.cropHintsParams, options); + if (message.productSearchParams != null && message.hasOwnProperty("productSearchParams")) + object.productSearchParams = $root.google.cloud.vision.v1p4beta1.ProductSearchParams.toObject(message.productSearchParams, options); + if (message.webDetectionParams != null && message.hasOwnProperty("webDetectionParams")) + object.webDetectionParams = $root.google.cloud.vision.v1p4beta1.WebDetectionParams.toObject(message.webDetectionParams, options); + return object; + }; + + /** + * Converts this ImageContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImageContext + * @instance + * @returns {Object.} JSON object + */ + ImageContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageContext; + })(); + + v1p4beta1.AnnotateImageRequest = (function() { + + /** + * Properties of an AnnotateImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAnnotateImageRequest + * @property {google.cloud.vision.v1p4beta1.IImage|null} [image] AnnotateImageRequest image + * @property {Array.|null} [features] AnnotateImageRequest features + * @property {google.cloud.vision.v1p4beta1.IImageContext|null} [imageContext] AnnotateImageRequest imageContext + */ + + /** + * Constructs a new AnnotateImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AnnotateImageRequest. + * @implements IAnnotateImageRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageRequest=} [properties] Properties to set + */ + function AnnotateImageRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AnnotateImageRequest image. + * @member {google.cloud.vision.v1p4beta1.IImage|null|undefined} image + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.image = null; + + /** + * AnnotateImageRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateImageRequest imageContext. + * @member {google.cloud.vision.v1p4beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @instance + */ + AnnotateImageRequest.prototype.imageContext = null; + + /** + * Creates a new AnnotateImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageRequest} AnnotateImageRequest instance + */ + AnnotateImageRequest.create = function create(properties) { + return new AnnotateImageRequest(properties); + }; + + /** + * Encodes the specified AnnotateImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && message.hasOwnProperty("image")) + $root.google.cloud.vision.v1p4beta1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p4beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p4beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageRequest} message AnnotateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.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.vision.v1p4beta1.AnnotateImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = $root.google.cloud.vision.v1p4beta1.Image.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p4beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageRequest} AnnotateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.vision.v1p4beta1.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p4beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageRequest} AnnotateImageRequest + */ + AnnotateImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageRequest.image: object expected"); + message.image = $root.google.cloud.vision.v1p4beta1.Image.fromObject(object.image); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p4beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.fromObject(object.imageContext); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.AnnotateImageRequest} message AnnotateImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.image = null; + object.imageContext = null; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.vision.v1p4beta1.Image.toObject(message.image, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p4beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.toObject(message.imageContext, options); + return object; + }; + + /** + * Converts this AnnotateImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageRequest; + })(); + + v1p4beta1.ImageAnnotationContext = (function() { + + /** + * Properties of an ImageAnnotationContext. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImageAnnotationContext + * @property {string|null} [uri] ImageAnnotationContext uri + * @property {number|null} [pageNumber] ImageAnnotationContext pageNumber + */ + + /** + * Constructs a new ImageAnnotationContext. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImageAnnotationContext. + * @implements IImageAnnotationContext + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImageAnnotationContext=} [properties] Properties to set + */ + function ImageAnnotationContext(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]]; + } + + /** + * ImageAnnotationContext uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.uri = ""; + + /** + * ImageAnnotationContext pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @instance + */ + ImageAnnotationContext.prototype.pageNumber = 0; + + /** + * Creates a new ImageAnnotationContext instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p4beta1.IImageAnnotationContext=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImageAnnotationContext} ImageAnnotationContext instance + */ + ImageAnnotationContext.create = function create(properties) { + return new ImageAnnotationContext(properties); + }; + + /** + * Encodes the specified ImageAnnotationContext message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageAnnotationContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p4beta1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + return writer; + }; + + /** + * Encodes the specified ImageAnnotationContext message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImageAnnotationContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p4beta1.IImageAnnotationContext} message ImageAnnotationContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageAnnotationContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.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.vision.v1p4beta1.ImageAnnotationContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + message.pageNumber = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageAnnotationContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImageAnnotationContext} ImageAnnotationContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageAnnotationContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageAnnotationContext message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageAnnotationContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + return null; + }; + + /** + * Creates an ImageAnnotationContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImageAnnotationContext} ImageAnnotationContext + */ + ImageAnnotationContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImageAnnotationContext) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImageAnnotationContext(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + return message; + }; + + /** + * Creates a plain object from an ImageAnnotationContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @static + * @param {google.cloud.vision.v1p4beta1.ImageAnnotationContext} message ImageAnnotationContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageAnnotationContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.pageNumber = 0; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + return object; + }; + + /** + * Converts this ImageAnnotationContext to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImageAnnotationContext + * @instance + * @returns {Object.} JSON object + */ + ImageAnnotationContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageAnnotationContext; + })(); + + v1p4beta1.AnnotateImageResponse = (function() { + + /** + * Properties of an AnnotateImageResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAnnotateImageResponse + * @property {Array.|null} [faceAnnotations] AnnotateImageResponse faceAnnotations + * @property {Array.|null} [landmarkAnnotations] AnnotateImageResponse landmarkAnnotations + * @property {Array.|null} [logoAnnotations] AnnotateImageResponse logoAnnotations + * @property {Array.|null} [labelAnnotations] AnnotateImageResponse labelAnnotations + * @property {Array.|null} [localizedObjectAnnotations] AnnotateImageResponse localizedObjectAnnotations + * @property {Array.|null} [textAnnotations] AnnotateImageResponse textAnnotations + * @property {google.cloud.vision.v1p4beta1.ITextAnnotation|null} [fullTextAnnotation] AnnotateImageResponse fullTextAnnotation + * @property {google.cloud.vision.v1p4beta1.ISafeSearchAnnotation|null} [safeSearchAnnotation] AnnotateImageResponse safeSearchAnnotation + * @property {google.cloud.vision.v1p4beta1.IImageProperties|null} [imagePropertiesAnnotation] AnnotateImageResponse imagePropertiesAnnotation + * @property {google.cloud.vision.v1p4beta1.ICropHintsAnnotation|null} [cropHintsAnnotation] AnnotateImageResponse cropHintsAnnotation + * @property {google.cloud.vision.v1p4beta1.IWebDetection|null} [webDetection] AnnotateImageResponse webDetection + * @property {google.cloud.vision.v1p4beta1.IProductSearchResults|null} [productSearchResults] AnnotateImageResponse productSearchResults + * @property {google.rpc.IStatus|null} [error] AnnotateImageResponse error + * @property {google.cloud.vision.v1p4beta1.IImageAnnotationContext|null} [context] AnnotateImageResponse context + */ + + /** + * Constructs a new AnnotateImageResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AnnotateImageResponse. + * @implements IAnnotateImageResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageResponse=} [properties] Properties to set + */ + function AnnotateImageResponse(properties) { + this.faceAnnotations = []; + this.landmarkAnnotations = []; + this.logoAnnotations = []; + this.labelAnnotations = []; + this.localizedObjectAnnotations = []; + this.textAnnotations = []; + 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]]; + } + + /** + * AnnotateImageResponse faceAnnotations. + * @member {Array.} faceAnnotations + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.faceAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse landmarkAnnotations. + * @member {Array.} landmarkAnnotations + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.landmarkAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse logoAnnotations. + * @member {Array.} logoAnnotations + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.logoAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse labelAnnotations. + * @member {Array.} labelAnnotations + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.labelAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse localizedObjectAnnotations. + * @member {Array.} localizedObjectAnnotations + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.localizedObjectAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.textAnnotations = $util.emptyArray; + + /** + * AnnotateImageResponse fullTextAnnotation. + * @member {google.cloud.vision.v1p4beta1.ITextAnnotation|null|undefined} fullTextAnnotation + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.fullTextAnnotation = null; + + /** + * AnnotateImageResponse safeSearchAnnotation. + * @member {google.cloud.vision.v1p4beta1.ISafeSearchAnnotation|null|undefined} safeSearchAnnotation + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.safeSearchAnnotation = null; + + /** + * AnnotateImageResponse imagePropertiesAnnotation. + * @member {google.cloud.vision.v1p4beta1.IImageProperties|null|undefined} imagePropertiesAnnotation + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.imagePropertiesAnnotation = null; + + /** + * AnnotateImageResponse cropHintsAnnotation. + * @member {google.cloud.vision.v1p4beta1.ICropHintsAnnotation|null|undefined} cropHintsAnnotation + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.cropHintsAnnotation = null; + + /** + * AnnotateImageResponse webDetection. + * @member {google.cloud.vision.v1p4beta1.IWebDetection|null|undefined} webDetection + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.webDetection = null; + + /** + * AnnotateImageResponse productSearchResults. + * @member {google.cloud.vision.v1p4beta1.IProductSearchResults|null|undefined} productSearchResults + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.productSearchResults = null; + + /** + * AnnotateImageResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.error = null; + + /** + * AnnotateImageResponse context. + * @member {google.cloud.vision.v1p4beta1.IImageAnnotationContext|null|undefined} context + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + */ + AnnotateImageResponse.prototype.context = null; + + /** + * Creates a new AnnotateImageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageResponse} AnnotateImageResponse instance + */ + AnnotateImageResponse.create = function create(properties) { + return new AnnotateImageResponse(properties); + }; + + /** + * Encodes the specified AnnotateImageResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faceAnnotations != null && message.faceAnnotations.length) + for (var i = 0; i < message.faceAnnotations.length; ++i) + $root.google.cloud.vision.v1p4beta1.FaceAnnotation.encode(message.faceAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.landmarkAnnotations != null && message.landmarkAnnotations.length) + for (var i = 0; i < message.landmarkAnnotations.length; ++i) + $root.google.cloud.vision.v1p4beta1.EntityAnnotation.encode(message.landmarkAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.logoAnnotations != null && message.logoAnnotations.length) + for (var i = 0; i < message.logoAnnotations.length; ++i) + $root.google.cloud.vision.v1p4beta1.EntityAnnotation.encode(message.logoAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labelAnnotations != null && message.labelAnnotations.length) + for (var i = 0; i < message.labelAnnotations.length; ++i) + $root.google.cloud.vision.v1p4beta1.EntityAnnotation.encode(message.labelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.vision.v1p4beta1.EntityAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + $root.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.encode(message.safeSearchAnnotation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + $root.google.cloud.vision.v1p4beta1.ImageProperties.encode(message.imagePropertiesAnnotation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + $root.google.cloud.vision.v1p4beta1.CropHintsAnnotation.encode(message.cropHintsAnnotation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.encode(message.fullTextAnnotation, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + $root.google.cloud.vision.v1p4beta1.WebDetection.encode(message.webDetection, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) + $root.google.cloud.vision.v1p4beta1.ProductSearchResults.encode(message.productSearchResults, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.context != null && message.hasOwnProperty("context")) + $root.google.cloud.vision.v1p4beta1.ImageAnnotationContext.encode(message.context, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.localizedObjectAnnotations != null && message.localizedObjectAnnotations.length) + for (var i = 0; i < message.localizedObjectAnnotations.length; ++i) + $root.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.encode(message.localizedObjectAnnotations[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateImageResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateImageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateImageResponse} message AnnotateImageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateImageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.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.vision.v1p4beta1.AnnotateImageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.faceAnnotations && message.faceAnnotations.length)) + message.faceAnnotations = []; + message.faceAnnotations.push($root.google.cloud.vision.v1p4beta1.FaceAnnotation.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.landmarkAnnotations && message.landmarkAnnotations.length)) + message.landmarkAnnotations = []; + message.landmarkAnnotations.push($root.google.cloud.vision.v1p4beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.logoAnnotations && message.logoAnnotations.length)) + message.logoAnnotations = []; + message.logoAnnotations.push($root.google.cloud.vision.v1p4beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.labelAnnotations && message.labelAnnotations.length)) + message.labelAnnotations = []; + message.labelAnnotations.push($root.google.cloud.vision.v1p4beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 22: + if (!(message.localizedObjectAnnotations && message.localizedObjectAnnotations.length)) + message.localizedObjectAnnotations = []; + message.localizedObjectAnnotations.push($root.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.vision.v1p4beta1.EntityAnnotation.decode(reader, reader.uint32())); + break; + case 12: + message.fullTextAnnotation = $root.google.cloud.vision.v1p4beta1.TextAnnotation.decode(reader, reader.uint32()); + break; + case 6: + message.safeSearchAnnotation = $root.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.decode(reader, reader.uint32()); + break; + case 8: + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p4beta1.ImageProperties.decode(reader, reader.uint32()); + break; + case 11: + message.cropHintsAnnotation = $root.google.cloud.vision.v1p4beta1.CropHintsAnnotation.decode(reader, reader.uint32()); + break; + case 13: + message.webDetection = $root.google.cloud.vision.v1p4beta1.WebDetection.decode(reader, reader.uint32()); + break; + case 14: + message.productSearchResults = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.decode(reader, reader.uint32()); + break; + case 9: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 21: + message.context = $root.google.cloud.vision.v1p4beta1.ImageAnnotationContext.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateImageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageResponse} AnnotateImageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateImageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateImageResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateImageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faceAnnotations != null && message.hasOwnProperty("faceAnnotations")) { + if (!Array.isArray(message.faceAnnotations)) + return "faceAnnotations: array expected"; + for (var i = 0; i < message.faceAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.FaceAnnotation.verify(message.faceAnnotations[i]); + if (error) + return "faceAnnotations." + error; + } + } + if (message.landmarkAnnotations != null && message.hasOwnProperty("landmarkAnnotations")) { + if (!Array.isArray(message.landmarkAnnotations)) + return "landmarkAnnotations: array expected"; + for (var i = 0; i < message.landmarkAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.verify(message.landmarkAnnotations[i]); + if (error) + return "landmarkAnnotations." + error; + } + } + if (message.logoAnnotations != null && message.hasOwnProperty("logoAnnotations")) { + if (!Array.isArray(message.logoAnnotations)) + return "logoAnnotations: array expected"; + for (var i = 0; i < message.logoAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.verify(message.logoAnnotations[i]); + if (error) + return "logoAnnotations." + error; + } + } + if (message.labelAnnotations != null && message.hasOwnProperty("labelAnnotations")) { + if (!Array.isArray(message.labelAnnotations)) + return "labelAnnotations: array expected"; + for (var i = 0; i < message.labelAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.verify(message.labelAnnotations[i]); + if (error) + return "labelAnnotations." + error; + } + } + if (message.localizedObjectAnnotations != null && message.hasOwnProperty("localizedObjectAnnotations")) { + if (!Array.isArray(message.localizedObjectAnnotations)) + return "localizedObjectAnnotations: array expected"; + for (var i = 0; i < message.localizedObjectAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.verify(message.localizedObjectAnnotations[i]); + if (error) + return "localizedObjectAnnotations." + error; + } + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.verify(message.fullTextAnnotation); + if (error) + return "fullTextAnnotation." + error; + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) { + var error = $root.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.verify(message.safeSearchAnnotation); + if (error) + return "safeSearchAnnotation." + error; + } + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) { + var error = $root.google.cloud.vision.v1p4beta1.ImageProperties.verify(message.imagePropertiesAnnotation); + if (error) + return "imagePropertiesAnnotation." + error; + } + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) { + var error = $root.google.cloud.vision.v1p4beta1.CropHintsAnnotation.verify(message.cropHintsAnnotation); + if (error) + return "cropHintsAnnotation." + error; + } + if (message.webDetection != null && message.hasOwnProperty("webDetection")) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.verify(message.webDetection); + if (error) + return "webDetection." + error; + } + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.verify(message.productSearchResults); + if (error) + return "productSearchResults." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.vision.v1p4beta1.ImageAnnotationContext.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates an AnnotateImageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AnnotateImageResponse} AnnotateImageResponse + */ + AnnotateImageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse(); + if (object.faceAnnotations) { + if (!Array.isArray(object.faceAnnotations)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.faceAnnotations: array expected"); + message.faceAnnotations = []; + for (var i = 0; i < object.faceAnnotations.length; ++i) { + if (typeof object.faceAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.faceAnnotations: object expected"); + message.faceAnnotations[i] = $root.google.cloud.vision.v1p4beta1.FaceAnnotation.fromObject(object.faceAnnotations[i]); + } + } + if (object.landmarkAnnotations) { + if (!Array.isArray(object.landmarkAnnotations)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.landmarkAnnotations: array expected"); + message.landmarkAnnotations = []; + for (var i = 0; i < object.landmarkAnnotations.length; ++i) { + if (typeof object.landmarkAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.landmarkAnnotations: object expected"); + message.landmarkAnnotations[i] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.fromObject(object.landmarkAnnotations[i]); + } + } + if (object.logoAnnotations) { + if (!Array.isArray(object.logoAnnotations)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.logoAnnotations: array expected"); + message.logoAnnotations = []; + for (var i = 0; i < object.logoAnnotations.length; ++i) { + if (typeof object.logoAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.logoAnnotations: object expected"); + message.logoAnnotations[i] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.fromObject(object.logoAnnotations[i]); + } + } + if (object.labelAnnotations) { + if (!Array.isArray(object.labelAnnotations)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.labelAnnotations: array expected"); + message.labelAnnotations = []; + for (var i = 0; i < object.labelAnnotations.length; ++i) { + if (typeof object.labelAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.labelAnnotations: object expected"); + message.labelAnnotations[i] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.fromObject(object.labelAnnotations[i]); + } + } + if (object.localizedObjectAnnotations) { + if (!Array.isArray(object.localizedObjectAnnotations)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.localizedObjectAnnotations: array expected"); + message.localizedObjectAnnotations = []; + for (var i = 0; i < object.localizedObjectAnnotations.length; ++i) { + if (typeof object.localizedObjectAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.localizedObjectAnnotations: object expected"); + message.localizedObjectAnnotations[i] = $root.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.fromObject(object.localizedObjectAnnotations[i]); + } + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.fullTextAnnotation != null) { + if (typeof object.fullTextAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.fullTextAnnotation: object expected"); + message.fullTextAnnotation = $root.google.cloud.vision.v1p4beta1.TextAnnotation.fromObject(object.fullTextAnnotation); + } + if (object.safeSearchAnnotation != null) { + if (typeof object.safeSearchAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.safeSearchAnnotation: object expected"); + message.safeSearchAnnotation = $root.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.fromObject(object.safeSearchAnnotation); + } + if (object.imagePropertiesAnnotation != null) { + if (typeof object.imagePropertiesAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.imagePropertiesAnnotation: object expected"); + message.imagePropertiesAnnotation = $root.google.cloud.vision.v1p4beta1.ImageProperties.fromObject(object.imagePropertiesAnnotation); + } + if (object.cropHintsAnnotation != null) { + if (typeof object.cropHintsAnnotation !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.cropHintsAnnotation: object expected"); + message.cropHintsAnnotation = $root.google.cloud.vision.v1p4beta1.CropHintsAnnotation.fromObject(object.cropHintsAnnotation); + } + if (object.webDetection != null) { + if (typeof object.webDetection !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.webDetection: object expected"); + message.webDetection = $root.google.cloud.vision.v1p4beta1.WebDetection.fromObject(object.webDetection); + } + if (object.productSearchResults != null) { + if (typeof object.productSearchResults !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.productSearchResults: object expected"); + message.productSearchResults = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.fromObject(object.productSearchResults); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateImageResponse.context: object expected"); + message.context = $root.google.cloud.vision.v1p4beta1.ImageAnnotationContext.fromObject(object.context); + } + return message; + }; + + /** + * Creates a plain object from an AnnotateImageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @static + * @param {google.cloud.vision.v1p4beta1.AnnotateImageResponse} message AnnotateImageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateImageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.faceAnnotations = []; + object.landmarkAnnotations = []; + object.logoAnnotations = []; + object.labelAnnotations = []; + object.textAnnotations = []; + object.localizedObjectAnnotations = []; + } + if (options.defaults) { + object.safeSearchAnnotation = null; + object.imagePropertiesAnnotation = null; + object.error = null; + object.cropHintsAnnotation = null; + object.fullTextAnnotation = null; + object.webDetection = null; + object.productSearchResults = null; + object.context = null; + } + if (message.faceAnnotations && message.faceAnnotations.length) { + object.faceAnnotations = []; + for (var j = 0; j < message.faceAnnotations.length; ++j) + object.faceAnnotations[j] = $root.google.cloud.vision.v1p4beta1.FaceAnnotation.toObject(message.faceAnnotations[j], options); + } + if (message.landmarkAnnotations && message.landmarkAnnotations.length) { + object.landmarkAnnotations = []; + for (var j = 0; j < message.landmarkAnnotations.length; ++j) + object.landmarkAnnotations[j] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.toObject(message.landmarkAnnotations[j], options); + } + if (message.logoAnnotations && message.logoAnnotations.length) { + object.logoAnnotations = []; + for (var j = 0; j < message.logoAnnotations.length; ++j) + object.logoAnnotations[j] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.toObject(message.logoAnnotations[j], options); + } + if (message.labelAnnotations && message.labelAnnotations.length) { + object.labelAnnotations = []; + for (var j = 0; j < message.labelAnnotations.length; ++j) + object.labelAnnotations[j] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.toObject(message.labelAnnotations[j], options); + } + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.vision.v1p4beta1.EntityAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.safeSearchAnnotation != null && message.hasOwnProperty("safeSearchAnnotation")) + object.safeSearchAnnotation = $root.google.cloud.vision.v1p4beta1.SafeSearchAnnotation.toObject(message.safeSearchAnnotation, options); + if (message.imagePropertiesAnnotation != null && message.hasOwnProperty("imagePropertiesAnnotation")) + object.imagePropertiesAnnotation = $root.google.cloud.vision.v1p4beta1.ImageProperties.toObject(message.imagePropertiesAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.cropHintsAnnotation != null && message.hasOwnProperty("cropHintsAnnotation")) + object.cropHintsAnnotation = $root.google.cloud.vision.v1p4beta1.CropHintsAnnotation.toObject(message.cropHintsAnnotation, options); + if (message.fullTextAnnotation != null && message.hasOwnProperty("fullTextAnnotation")) + object.fullTextAnnotation = $root.google.cloud.vision.v1p4beta1.TextAnnotation.toObject(message.fullTextAnnotation, options); + if (message.webDetection != null && message.hasOwnProperty("webDetection")) + object.webDetection = $root.google.cloud.vision.v1p4beta1.WebDetection.toObject(message.webDetection, options); + if (message.productSearchResults != null && message.hasOwnProperty("productSearchResults")) + object.productSearchResults = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.toObject(message.productSearchResults, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.vision.v1p4beta1.ImageAnnotationContext.toObject(message.context, options); + if (message.localizedObjectAnnotations && message.localizedObjectAnnotations.length) { + object.localizedObjectAnnotations = []; + for (var j = 0; j < message.localizedObjectAnnotations.length; ++j) + object.localizedObjectAnnotations[j] = $root.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.toObject(message.localizedObjectAnnotations[j], options); + } + return object; + }; + + /** + * Converts this AnnotateImageResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AnnotateImageResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateImageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateImageResponse; + })(); + + v1p4beta1.AnnotateFileResponse = (function() { + + /** + * Properties of an AnnotateFileResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAnnotateFileResponse + * @property {google.cloud.vision.v1p4beta1.IInputConfig|null} [inputConfig] AnnotateFileResponse inputConfig + * @property {Array.|null} [responses] AnnotateFileResponse responses + * @property {number|null} [totalPages] AnnotateFileResponse totalPages + */ + + /** + * Constructs a new AnnotateFileResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AnnotateFileResponse. + * @implements IAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileResponse=} [properties] Properties to set + */ + function AnnotateFileResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AnnotateFileResponse inputConfig. + * @member {google.cloud.vision.v1p4beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.inputConfig = null; + + /** + * AnnotateFileResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.responses = $util.emptyArray; + + /** + * AnnotateFileResponse totalPages. + * @member {number} totalPages + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @instance + */ + AnnotateFileResponse.prototype.totalPages = 0; + + /** + * Creates a new AnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileResponse} AnnotateFileResponse instance + */ + AnnotateFileResponse.create = function create(properties) { + return new AnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p4beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalPages); + return writer; + }; + + /** + * Encodes the specified AnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileResponse} message AnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.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.vision.v1p4beta1.AnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + case 3: + message.totalPages = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileResponse} AnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateFileResponse.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.vision.v1p4beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + if (!$util.isInteger(message.totalPages)) + return "totalPages: integer expected"; + return null; + }; + + /** + * Creates an AnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileResponse} AnnotateFileResponse + */ + AnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AnnotateFileResponse(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileResponse.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + if (object.totalPages != null) + message.totalPages = object.totalPages | 0; + return message; + }; + + /** + * Creates a plain object from an AnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.AnnotateFileResponse} message AnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (options.defaults) { + object.inputConfig = null; + object.totalPages = 0; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.toObject(message.inputConfig, options); + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.toObject(message.responses[j], options); + } + if (message.totalPages != null && message.hasOwnProperty("totalPages")) + object.totalPages = message.totalPages; + return object; + }; + + /** + * Converts this AnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateFileResponse; + })(); + + v1p4beta1.BatchAnnotateImagesRequest = (function() { + + /** + * Properties of a BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IBatchAnnotateImagesRequest + * @property {Array.|null} [requests] BatchAnnotateImagesRequest requests + */ + + /** + * Constructs a new BatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a BatchAnnotateImagesRequest. + * @implements IBatchAnnotateImagesRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + */ + function BatchAnnotateImagesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchAnnotateImagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @instance + */ + BatchAnnotateImagesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest instance + */ + BatchAnnotateImagesRequest.create = function create(properties) { + return new BatchAnnotateImagesRequest(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesRequest} message BatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.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.vision.v1p4beta1.BatchAnnotateImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest} BatchAnnotateImagesRequest + */ + BatchAnnotateImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest} message BatchAnnotateImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesRequest; + })(); + + v1p4beta1.BatchAnnotateImagesResponse = (function() { + + /** + * Properties of a BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IBatchAnnotateImagesResponse + * @property {Array.|null} [responses] BatchAnnotateImagesResponse responses + */ + + /** + * Constructs a new BatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a BatchAnnotateImagesResponse. + * @implements IBatchAnnotateImagesResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + */ + function BatchAnnotateImagesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * BatchAnnotateImagesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @instance + */ + BatchAnnotateImagesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new BatchAnnotateImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse instance + */ + BatchAnnotateImagesResponse.create = function create(properties) { + return new BatchAnnotateImagesResponse(properties); + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateImagesResponse} message BatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.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.vision.v1p4beta1.BatchAnnotateImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} BatchAnnotateImagesResponse + */ + BatchAnnotateImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse} message BatchAnnotateImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p4beta1.AnnotateImageResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateImagesResponse; + })(); + + v1p4beta1.AnnotateFileRequest = (function() { + + /** + * Properties of an AnnotateFileRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAnnotateFileRequest + * @property {google.cloud.vision.v1p4beta1.IInputConfig|null} [inputConfig] AnnotateFileRequest inputConfig + * @property {Array.|null} [features] AnnotateFileRequest features + * @property {google.cloud.vision.v1p4beta1.IImageContext|null} [imageContext] AnnotateFileRequest imageContext + * @property {Array.|null} [pages] AnnotateFileRequest pages + */ + + /** + * Constructs a new AnnotateFileRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AnnotateFileRequest. + * @implements IAnnotateFileRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileRequest=} [properties] Properties to set + */ + function AnnotateFileRequest(properties) { + this.features = []; + this.pages = []; + 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]]; + } + + /** + * AnnotateFileRequest inputConfig. + * @member {google.cloud.vision.v1p4beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.inputConfig = null; + + /** + * AnnotateFileRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateFileRequest imageContext. + * @member {google.cloud.vision.v1p4beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.imageContext = null; + + /** + * AnnotateFileRequest pages. + * @member {Array.} pages + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @instance + */ + AnnotateFileRequest.prototype.pages = $util.emptyArray; + + /** + * Creates a new AnnotateFileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileRequest} AnnotateFileRequest instance + */ + AnnotateFileRequest.create = function create(properties) { + return new AnnotateFileRequest(properties); + }; + + /** + * Encodes the specified AnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileRequest} message AnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p4beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p4beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p4beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pages != null && message.pages.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.pages.length; ++i) + writer.int32(message.pages[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AnnotateFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAnnotateFileRequest} message AnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileRequest} AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileRequest.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.vision.v1p4beta1.AnnotateFileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p4beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.pages && message.pages.length)) + message.pages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.pages.push(reader.int32()); + } else + message.pages.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileRequest} AnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateFileRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateFileRequest.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.vision.v1p4beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p4beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) + if (!$util.isInteger(message.pages[i])) + return "pages: integer[] expected"; + } + return null; + }; + + /** + * Creates an AnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AnnotateFileRequest} AnnotateFileRequest + */ + AnnotateFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AnnotateFileRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AnnotateFileRequest(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p4beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.fromObject(object.imageContext); + } + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.vision.v1p4beta1.AnnotateFileRequest.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) + message.pages[i] = object.pages[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an AnnotateFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.AnnotateFileRequest} message AnnotateFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateFileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.features = []; + object.pages = []; + } + if (options.defaults) { + object.inputConfig = null; + object.imageContext = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.toObject(message.inputConfig, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p4beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.toObject(message.imageContext, options); + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = message.pages[j]; + } + return object; + }; + + /** + * Converts this AnnotateFileRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AnnotateFileRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotateFileRequest; + })(); + + v1p4beta1.BatchAnnotateFilesRequest = (function() { + + /** + * Properties of a BatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IBatchAnnotateFilesRequest + * @property {Array.|null} [requests] BatchAnnotateFilesRequest requests + */ + + /** + * Constructs a new BatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a BatchAnnotateFilesRequest. + * @implements IBatchAnnotateFilesRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest=} [properties] Properties to set + */ + function BatchAnnotateFilesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * BatchAnnotateFilesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @instance + */ + BatchAnnotateFilesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchAnnotateFilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest instance + */ + BatchAnnotateFilesRequest.create = function create(properties) { + return new BatchAnnotateFilesRequest(properties); + }; + + /** + * Encodes the specified BatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest} message BatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p4beta1.AnnotateFileRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesRequest} message BatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesRequest.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.vision.v1p4beta1.BatchAnnotateFilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p4beta1.AnnotateFileRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateFilesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateFilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AnnotateFileRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest} BatchAnnotateFilesRequest + */ + BatchAnnotateFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p4beta1.AnnotateFileRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest} message BatchAnnotateFilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateFilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p4beta1.AnnotateFileRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateFilesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateFilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateFilesRequest; + })(); + + v1p4beta1.BatchAnnotateFilesResponse = (function() { + + /** + * Properties of a BatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IBatchAnnotateFilesResponse + * @property {Array.|null} [responses] BatchAnnotateFilesResponse responses + */ + + /** + * Constructs a new BatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a BatchAnnotateFilesResponse. + * @implements IBatchAnnotateFilesResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse=} [properties] Properties to set + */ + function BatchAnnotateFilesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * BatchAnnotateFilesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @instance + */ + BatchAnnotateFilesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new BatchAnnotateFilesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse instance + */ + BatchAnnotateFilesResponse.create = function create(properties) { + return new BatchAnnotateFilesResponse(properties); + }; + + /** + * Encodes the specified BatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse} message BatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p4beta1.AnnotateFileResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchAnnotateFilesResponse} message BatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchAnnotateFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesResponse.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.vision.v1p4beta1.BatchAnnotateFilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p4beta1.AnnotateFileResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchAnnotateFilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchAnnotateFilesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchAnnotateFilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AnnotateFileResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates a BatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} BatchAnnotateFilesResponse + */ + BatchAnnotateFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p4beta1.AnnotateFileResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse} message BatchAnnotateFilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchAnnotateFilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p4beta1.AnnotateFileResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this BatchAnnotateFilesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchAnnotateFilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchAnnotateFilesResponse; + })(); + + v1p4beta1.AsyncAnnotateFileRequest = (function() { + + /** + * Properties of an AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAsyncAnnotateFileRequest + * @property {google.cloud.vision.v1p4beta1.IInputConfig|null} [inputConfig] AsyncAnnotateFileRequest inputConfig + * @property {Array.|null} [features] AsyncAnnotateFileRequest features + * @property {google.cloud.vision.v1p4beta1.IImageContext|null} [imageContext] AsyncAnnotateFileRequest imageContext + * @property {google.cloud.vision.v1p4beta1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileRequest outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AsyncAnnotateFileRequest. + * @implements IAsyncAnnotateFileRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest=} [properties] Properties to set + */ + function AsyncAnnotateFileRequest(properties) { + this.features = []; + 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]]; + } + + /** + * AsyncAnnotateFileRequest inputConfig. + * @member {google.cloud.vision.v1p4beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.inputConfig = null; + + /** + * AsyncAnnotateFileRequest features. + * @member {Array.} features + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.features = $util.emptyArray; + + /** + * AsyncAnnotateFileRequest imageContext. + * @member {google.cloud.vision.v1p4beta1.IImageContext|null|undefined} imageContext + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.imageContext = null; + + /** + * AsyncAnnotateFileRequest outputConfig. + * @member {google.cloud.vision.v1p4beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @instance + */ + AsyncAnnotateFileRequest.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest instance + */ + AsyncAnnotateFileRequest.create = function create(properties) { + return new AsyncAnnotateFileRequest(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p4beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + $root.google.cloud.vision.v1p4beta1.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + $root.google.cloud.vision.v1p4beta1.ImageContext.encode(message.imageContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p4beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileRequest} message AsyncAnnotateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.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.vision.v1p4beta1.AsyncAnnotateFileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push($root.google.cloud.vision.v1p4beta1.Feature.decode(reader, reader.uint32())); + break; + case 3: + message.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.decode(reader, reader.uint32()); + break; + case 4: + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileRequest.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.vision.v1p4beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Feature.verify(message.features[i]); + if (error) + return "features." + error; + } + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) { + var error = $root.google.cloud.vision.v1p4beta1.ImageContext.verify(message.imageContext); + if (error) + return "imageContext." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p4beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest} AsyncAnnotateFileRequest + */ + AsyncAnnotateFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) { + if (typeof object.features[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.features: object expected"); + message.features[i] = $root.google.cloud.vision.v1p4beta1.Feature.fromObject(object.features[i]); + } + } + if (object.imageContext != null) { + if (typeof object.imageContext !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.imageContext: object expected"); + message.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.fromObject(object.imageContext); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @static + * @param {google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest} message AsyncAnnotateFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputConfig = null; + object.imageContext = null; + object.outputConfig = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p4beta1.InputConfig.toObject(message.inputConfig, options); + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $root.google.cloud.vision.v1p4beta1.Feature.toObject(message.features[j], options); + } + if (message.imageContext != null && message.hasOwnProperty("imageContext")) + object.imageContext = $root.google.cloud.vision.v1p4beta1.ImageContext.toObject(message.imageContext, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileRequest; + })(); + + v1p4beta1.AsyncAnnotateFileResponse = (function() { + + /** + * Properties of an AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAsyncAnnotateFileResponse + * @property {google.cloud.vision.v1p4beta1.IOutputConfig|null} [outputConfig] AsyncAnnotateFileResponse outputConfig + */ + + /** + * Constructs a new AsyncAnnotateFileResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AsyncAnnotateFileResponse. + * @implements IAsyncAnnotateFileResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse=} [properties] Properties to set + */ + function AsyncAnnotateFileResponse(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]]; + } + + /** + * AsyncAnnotateFileResponse outputConfig. + * @member {google.cloud.vision.v1p4beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @instance + */ + AsyncAnnotateFileResponse.prototype.outputConfig = null; + + /** + * Creates a new AsyncAnnotateFileResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse instance + */ + AsyncAnnotateFileResponse.create = function create(properties) { + return new AsyncAnnotateFileResponse(properties); + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p4beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncAnnotateFileResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncAnnotateFileResponse} message AsyncAnnotateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncAnnotateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.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.vision.v1p4beta1.AsyncAnnotateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncAnnotateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncAnnotateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncAnnotateFileResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncAnnotateFileResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p4beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncAnnotateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse} AsyncAnnotateFileResponse + */ + AsyncAnnotateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncAnnotateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @static + * @param {google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse} message AsyncAnnotateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncAnnotateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncAnnotateFileResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncAnnotateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncAnnotateFileResponse; + })(); + + v1p4beta1.AsyncBatchAnnotateImagesRequest = (function() { + + /** + * Properties of an AsyncBatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAsyncBatchAnnotateImagesRequest + * @property {Array.|null} [requests] AsyncBatchAnnotateImagesRequest requests + * @property {google.cloud.vision.v1p4beta1.IOutputConfig|null} [outputConfig] AsyncBatchAnnotateImagesRequest outputConfig + */ + + /** + * Constructs a new AsyncBatchAnnotateImagesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AsyncBatchAnnotateImagesRequest. + * @implements IAsyncBatchAnnotateImagesRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest=} [properties] Properties to set + */ + function AsyncBatchAnnotateImagesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * AsyncBatchAnnotateImagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @instance + */ + AsyncBatchAnnotateImagesRequest.prototype.requests = $util.emptyArray; + + /** + * AsyncBatchAnnotateImagesRequest outputConfig. + * @member {google.cloud.vision.v1p4beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @instance + */ + AsyncBatchAnnotateImagesRequest.prototype.outputConfig = null; + + /** + * Creates a new AsyncBatchAnnotateImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest instance + */ + AsyncBatchAnnotateImagesRequest.create = function create(properties) { + return new AsyncBatchAnnotateImagesRequest(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest} message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p4beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesRequest} message AsyncBatchAnnotateImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesRequest.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.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.decode(reader, reader.uint32())); + break; + case 2: + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p4beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest} AsyncBatchAnnotateImagesRequest + */ + AsyncBatchAnnotateImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.fromObject(object.requests[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest} message AsyncBatchAnnotateImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.outputConfig = null; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p4beta1.AnnotateImageRequest.toObject(message.requests[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncBatchAnnotateImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateImagesRequest; + })(); + + v1p4beta1.AsyncBatchAnnotateImagesResponse = (function() { + + /** + * Properties of an AsyncBatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAsyncBatchAnnotateImagesResponse + * @property {google.cloud.vision.v1p4beta1.IOutputConfig|null} [outputConfig] AsyncBatchAnnotateImagesResponse outputConfig + */ + + /** + * Constructs a new AsyncBatchAnnotateImagesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AsyncBatchAnnotateImagesResponse. + * @implements IAsyncBatchAnnotateImagesResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse=} [properties] Properties to set + */ + function AsyncBatchAnnotateImagesResponse(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]]; + } + + /** + * AsyncBatchAnnotateImagesResponse outputConfig. + * @member {google.cloud.vision.v1p4beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @instance + */ + AsyncBatchAnnotateImagesResponse.prototype.outputConfig = null; + + /** + * Creates a new AsyncBatchAnnotateImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse instance + */ + AsyncBatchAnnotateImagesResponse.create = function create(properties) { + return new AsyncBatchAnnotateImagesResponse(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse} message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.vision.v1p4beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateImagesResponse} message AsyncBatchAnnotateImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesResponse.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.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.vision.v1p4beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse} AsyncBatchAnnotateImagesResponse + */ + AsyncBatchAnnotateImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse(); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse} message AsyncBatchAnnotateImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputConfig = null; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.vision.v1p4beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this AsyncBatchAnnotateImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateImagesResponse; + })(); + + v1p4beta1.AsyncBatchAnnotateFilesRequest = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAsyncBatchAnnotateFilesRequest + * @property {Array.|null} [requests] AsyncBatchAnnotateFilesRequest requests + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AsyncBatchAnnotateFilesRequest. + * @implements IAsyncBatchAnnotateFilesRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesRequest(properties) { + this.requests = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @instance + */ + AsyncBatchAnnotateFilesRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new AsyncBatchAnnotateFilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest instance + */ + AsyncBatchAnnotateFilesRequest.create = function create(properties) { + return new AsyncBatchAnnotateFilesRequest(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.encode(message.requests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.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.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest} AsyncBatchAnnotateFilesRequest + */ + AsyncBatchAnnotateFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest(); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest} message AsyncBatchAnnotateFilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesRequest; + })(); + + v1p4beta1.AsyncBatchAnnotateFilesResponse = (function() { + + /** + * Properties of an AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAsyncBatchAnnotateFilesResponse + * @property {Array.|null} [responses] AsyncBatchAnnotateFilesResponse responses + */ + + /** + * Constructs a new AsyncBatchAnnotateFilesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AsyncBatchAnnotateFilesResponse. + * @implements IAsyncBatchAnnotateFilesResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + */ + function AsyncBatchAnnotateFilesResponse(properties) { + this.responses = []; + 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]]; + } + + /** + * AsyncBatchAnnotateFilesResponse responses. + * @member {Array.} responses + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @instance + */ + AsyncBatchAnnotateFilesResponse.prototype.responses = $util.emptyArray; + + /** + * Creates a new AsyncBatchAnnotateFilesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse instance + */ + AsyncBatchAnnotateFilesResponse.create = function create(properties) { + return new AsyncBatchAnnotateFilesResponse(properties); + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responses != null && message.responses.length) + for (var i = 0; i < message.responses.length; ++i) + $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.encode(message.responses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AsyncBatchAnnotateFilesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IAsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AsyncBatchAnnotateFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.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.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.responses && message.responses.length)) + message.responses = []; + message.responses.push($root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AsyncBatchAnnotateFilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AsyncBatchAnnotateFilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AsyncBatchAnnotateFilesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AsyncBatchAnnotateFilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responses != null && message.hasOwnProperty("responses")) { + if (!Array.isArray(message.responses)) + return "responses: array expected"; + for (var i = 0; i < message.responses.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.verify(message.responses[i]); + if (error) + return "responses." + error; + } + } + return null; + }; + + /** + * Creates an AsyncBatchAnnotateFilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse} AsyncBatchAnnotateFilesResponse + */ + AsyncBatchAnnotateFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse(); + if (object.responses) { + if (!Array.isArray(object.responses)) + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.responses: array expected"); + message.responses = []; + for (var i = 0; i < object.responses.length; ++i) { + if (typeof object.responses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.responses: object expected"); + message.responses[i] = $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.fromObject(object.responses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AsyncBatchAnnotateFilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse} message AsyncBatchAnnotateFilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AsyncBatchAnnotateFilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responses = []; + if (message.responses && message.responses.length) { + object.responses = []; + for (var j = 0; j < message.responses.length; ++j) + object.responses[j] = $root.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.toObject(message.responses[j], options); + } + return object; + }; + + /** + * Converts this AsyncBatchAnnotateFilesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse + * @instance + * @returns {Object.} JSON object + */ + AsyncBatchAnnotateFilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AsyncBatchAnnotateFilesResponse; + })(); + + v1p4beta1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IInputConfig + * @property {google.cloud.vision.v1p4beta1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {Uint8Array|null} [content] InputConfig content + * @property {string|null} [mimeType] InputConfig mimeType + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.vision.v1p4beta1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(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]]; + } + + /** + * InputConfig gcsSource. + * @member {google.cloud.vision.v1p4beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig content. + * @member {Uint8Array} content + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @instance + */ + InputConfig.prototype.content = $util.newBuffer([]); + + /** + * InputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @instance + */ + InputConfig.prototype.mimeType = ""; + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.vision.v1p4beta1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.content); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.InputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.vision.v1p4beta1.GcsSource.decode(reader, reader.uint32()); + break; + case 3: + message.content = reader.bytes(); + break; + case 2: + message.mimeType = 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.vision.v1p4beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.vision.v1p4beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + if (message.content != null && message.hasOwnProperty("content")) + if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content))) + return "content: buffer expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: 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.vision.v1p4beta1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.InputConfig) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.vision.v1p4beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.content != null) + if (typeof object.content === "string") + $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0); + else if (object.content.length) + message.content = object.content; + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.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.defaults) { + object.gcsSource = null; + object.mimeType = ""; + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.vision.v1p4beta1.GcsSource.toObject(message.gcsSource, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.content != null && message.hasOwnProperty("content")) + object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputConfig; + })(); + + v1p4beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IOutputConfig + * @property {google.cloud.vision.v1p4beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {number|null} [batchSize] OutputConfig batchSize + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig batchSize. + * @member {number} batchSize + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.batchSize = 0; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.vision.v1p4beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.batchSize); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.vision.v1p4beta1.GcsDestination.decode(reader, reader.uint32()); + break; + case 2: + message.batchSize = reader.int32(); + 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.vision.v1p4beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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"; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + var error = $root.google.cloud.vision.v1p4beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + if (!$util.isInteger(message.batchSize)) + return "batchSize: integer expected"; + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.OutputConfig) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.vision.v1p4beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.batchSize != null) + message.batchSize = object.batchSize | 0; + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.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 (options.defaults) { + object.gcsDestination = null; + object.batchSize = 0; + } + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + object.gcsDestination = $root.google.cloud.vision.v1p4beta1.GcsDestination.toObject(message.gcsDestination, options); + if (message.batchSize != null && message.hasOwnProperty("batchSize")) + object.batchSize = message.batchSize; + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1p4beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IGcsSource + * @property {string|null} [uri] GcsSource uri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.vision.v1p4beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(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]]; + } + + /** + * GcsSource uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p4beta1.GcsSource + * @instance + */ + GcsSource.prototype.uri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1p4beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1p4beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.GcsSource) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.GcsSource(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.GcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.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.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v1p4beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.vision.v1p4beta1.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 uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p4beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p4beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p4beta1.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = 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.vision.v1p4beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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.vision.v1p4beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.GcsDestination) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.GcsDestination + * @static + * @param {google.cloud.vision.v1p4beta1.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.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v1p4beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IOperationMetadata + * @property {google.cloud.vision.v1p4beta1.OperationMetadata.State|null} [state] OperationMetadata state + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.vision.v1p4beta1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata state. + * @member {google.cloud.vision.v1p4beta1.OperationMetadata.State} state + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.state = 0; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p4beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + 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.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.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"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.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; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.OperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATED": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vision.v1p4beta1.OperationMetadata.State[message.state] : message.state; + 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); + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.vision.v1p4beta1.OperationMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATED=1 CREATED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + * @property {number} CANCELLED=4 CANCELLED value + */ + OperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return OperationMetadata; + })(); + + v1p4beta1.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.vision.v1p4beta1.IVertex=} [properties] Properties to set + */ + function Vertex(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]]; + } + + /** + * Vertex x. + * @member {number} x + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {google.cloud.vision.v1p4beta1.IVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {google.cloud.vision.v1p4beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && message.hasOwnProperty("x")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.x); + if (message.y != null && message.hasOwnProperty("y")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.y); + return writer; + }; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {google.cloud.vision.v1p4beta1.IVertex} message Vertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.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.vision.v1p4beta1.Vertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.int32(); + break; + case 2: + message.y = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Vertex} Vertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vertex message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (!$util.isInteger(message.x)) + return "x: integer expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (!$util.isInteger(message.y)) + return "y: integer expected"; + return null; + }; + + /** + * Creates a Vertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Vertex) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Vertex(); + if (object.x != null) + message.x = object.x | 0; + if (object.y != null) + message.y = object.y | 0; + return message; + }; + + /** + * Creates a plain object from a Vertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @static + * @param {google.cloud.vision.v1p4beta1.Vertex} message Vertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vertex.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 = message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = message.y; + return object; + }; + + /** + * Converts this Vertex to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Vertex + * @instance + * @returns {Object.} JSON object + */ + Vertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Vertex; + })(); + + v1p4beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.vision.v1p4beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.vision.v1p4beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p4beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.vision.v1p4beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vision.v1p4beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.NormalizedVertex + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NormalizedVertex; + })(); + + v1p4beta1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.vision.v1p4beta1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.vertices = []; + 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 vertices. + * @member {Array.} vertices + * @memberof google.cloud.vision.v1p4beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.vision.v1p4beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p4beta1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p4beta1.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.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.vision.v1p4beta1.Vertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.vision.v1p4beta1.Vertex.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.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.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Vertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + 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.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.BoundingPoly) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.vision.v1p4beta1.BoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.vision.v1p4beta1.Vertex.fromObject(object.vertices[i]); + } + } + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.vision.v1p4beta1.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.vision.v1p4beta1.BoundingPoly + * @static + * @param {google.cloud.vision.v1p4beta1.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.vertices = []; + object.normalizedVertices = []; + } + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.vision.v1p4beta1.Vertex.toObject(message.vertices[j], options); + } + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.vision.v1p4beta1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoundingPoly; + })(); + + v1p4beta1.Position = (function() { + + /** + * Properties of a Position. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IPosition + * @property {number|null} [x] Position x + * @property {number|null} [y] Position y + * @property {number|null} [z] Position z + */ + + /** + * Constructs a new Position. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Position. + * @implements IPosition + * @constructor + * @param {google.cloud.vision.v1p4beta1.IPosition=} [properties] Properties to set + */ + function Position(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]]; + } + + /** + * Position x. + * @member {number} x + * @memberof google.cloud.vision.v1p4beta1.Position + * @instance + */ + Position.prototype.x = 0; + + /** + * Position y. + * @member {number} y + * @memberof google.cloud.vision.v1p4beta1.Position + * @instance + */ + Position.prototype.y = 0; + + /** + * Position z. + * @member {number} z + * @memberof google.cloud.vision.v1p4beta1.Position + * @instance + */ + Position.prototype.z = 0; + + /** + * Creates a new Position instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {google.cloud.vision.v1p4beta1.IPosition=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Position} Position instance + */ + Position.create = function create(properties) { + return new Position(properties); + }; + + /** + * Encodes the specified Position message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Position.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {google.cloud.vision.v1p4beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.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); + if (message.z != null && message.hasOwnProperty("z")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.z); + return writer; + }; + + /** + * Encodes the specified Position message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Position.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {google.cloud.vision.v1p4beta1.IPosition} message Position message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Position.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Position message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.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.vision.v1p4beta1.Position(); + 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; + case 3: + message.z = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Position message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Position} Position + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Position.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Position message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Position.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"; + if (message.z != null && message.hasOwnProperty("z")) + if (typeof message.z !== "number") + return "z: number expected"; + return null; + }; + + /** + * Creates a Position message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Position} Position + */ + Position.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Position) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Position(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + if (object.z != null) + message.z = Number(object.z); + return message; + }; + + /** + * Creates a plain object from a Position message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Position + * @static + * @param {google.cloud.vision.v1p4beta1.Position} message Position + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Position.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + object.z = 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; + if (message.z != null && message.hasOwnProperty("z")) + object.z = options.json && !isFinite(message.z) ? String(message.z) : message.z; + return object; + }; + + /** + * Converts this Position to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Position + * @instance + * @returns {Object.} JSON object + */ + Position.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Position; + })(); + + v1p4beta1.ProductSearchParams = (function() { + + /** + * Properties of a ProductSearchParams. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IProductSearchParams + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingPoly] ProductSearchParams boundingPoly + * @property {string|null} [productSet] ProductSearchParams productSet + * @property {Array.|null} [productCategories] ProductSearchParams productCategories + * @property {string|null} [filter] ProductSearchParams filter + */ + + /** + * Constructs a new ProductSearchParams. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ProductSearchParams. + * @implements IProductSearchParams + * @constructor + * @param {google.cloud.vision.v1p4beta1.IProductSearchParams=} [properties] Properties to set + */ + function ProductSearchParams(properties) { + this.productCategories = []; + 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]]; + } + + /** + * ProductSearchParams boundingPoly. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.boundingPoly = null; + + /** + * ProductSearchParams productSet. + * @member {string} productSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.productSet = ""; + + /** + * ProductSearchParams productCategories. + * @member {Array.} productCategories + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.productCategories = $util.emptyArray; + + /** + * ProductSearchParams filter. + * @member {string} filter + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @instance + */ + ProductSearchParams.prototype.filter = ""; + + /** + * Creates a new ProductSearchParams instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSearchParams=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ProductSearchParams} ProductSearchParams instance + */ + ProductSearchParams.create = function create(properties) { + return new ProductSearchParams(properties); + }; + + /** + * Encodes the specified ProductSearchParams message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSearchParams} message ProductSearchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSet != null && message.hasOwnProperty("productSet")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.productSet); + if (message.productCategories != null && message.productCategories.length) + for (var i = 0; i < message.productCategories.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.productCategories[i]); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSearchParams message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSearchParams} message ProductSearchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ProductSearchParams} ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchParams.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.vision.v1p4beta1.ProductSearchParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 6: + message.productSet = reader.string(); + break; + case 7: + if (!(message.productCategories && message.productCategories.length)) + message.productCategories = []; + message.productCategories.push(reader.string()); + break; + case 8: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSearchParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ProductSearchParams} ProductSearchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSearchParams message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSearchParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + if (!$util.isString(message.productSet)) + return "productSet: string expected"; + if (message.productCategories != null && message.hasOwnProperty("productCategories")) { + if (!Array.isArray(message.productCategories)) + return "productCategories: array expected"; + for (var i = 0; i < message.productCategories.length; ++i) + if (!$util.isString(message.productCategories[i])) + return "productCategories: string[] expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ProductSearchParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ProductSearchParams} ProductSearchParams + */ + ProductSearchParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ProductSearchParams) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ProductSearchParams(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchParams.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.productSet != null) + message.productSet = String(object.productSet); + if (object.productCategories) { + if (!Array.isArray(object.productCategories)) + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchParams.productCategories: array expected"); + message.productCategories = []; + for (var i = 0; i < object.productCategories.length; ++i) + message.productCategories[i] = String(object.productCategories[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ProductSearchParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchParams} message ProductSearchParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSearchParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productCategories = []; + if (options.defaults) { + object.productSet = ""; + object.filter = ""; + object.boundingPoly = null; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = message.productSet; + if (message.productCategories && message.productCategories.length) { + object.productCategories = []; + for (var j = 0; j < message.productCategories.length; ++j) + object.productCategories[j] = message.productCategories[j]; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingPoly, options); + return object; + }; + + /** + * Converts this ProductSearchParams to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ProductSearchParams + * @instance + * @returns {Object.} JSON object + */ + ProductSearchParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSearchParams; + })(); + + v1p4beta1.ProductSearchResults = (function() { + + /** + * Properties of a ProductSearchResults. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IProductSearchResults + * @property {google.protobuf.ITimestamp|null} [indexTime] ProductSearchResults indexTime + * @property {Array.|null} [results] ProductSearchResults results + * @property {Array.|null} [productGroupedResults] ProductSearchResults productGroupedResults + */ + + /** + * Constructs a new ProductSearchResults. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ProductSearchResults. + * @implements IProductSearchResults + * @constructor + * @param {google.cloud.vision.v1p4beta1.IProductSearchResults=} [properties] Properties to set + */ + function ProductSearchResults(properties) { + this.results = []; + this.productGroupedResults = []; + 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]]; + } + + /** + * ProductSearchResults indexTime. + * @member {google.protobuf.ITimestamp|null|undefined} indexTime + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.indexTime = null; + + /** + * ProductSearchResults results. + * @member {Array.} results + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.results = $util.emptyArray; + + /** + * ProductSearchResults productGroupedResults. + * @member {Array.} productGroupedResults + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @instance + */ + ProductSearchResults.prototype.productGroupedResults = $util.emptyArray; + + /** + * Creates a new ProductSearchResults instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSearchResults=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults} ProductSearchResults instance + */ + ProductSearchResults.create = function create(properties) { + return new ProductSearchResults(properties); + }; + + /** + * Encodes the specified ProductSearchResults message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSearchResults} message ProductSearchResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexTime != null && message.hasOwnProperty("indexTime")) + $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.encode(message.results[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.productGroupedResults != null && message.productGroupedResults.length) + for (var i = 0; i < message.productGroupedResults.length; ++i) + $root.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.encode(message.productGroupedResults[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSearchResults message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSearchResults} message ProductSearchResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSearchResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults} ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchResults.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.vision.v1p4beta1.ProductSearchResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.productGroupedResults && message.productGroupedResults.length)) + message.productGroupedResults = []; + message.productGroupedResults.push($root.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSearchResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults} ProductSearchResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSearchResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSearchResults message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSearchResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexTime != null && message.hasOwnProperty("indexTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (error) + return "indexTime." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.productGroupedResults != null && message.hasOwnProperty("productGroupedResults")) { + if (!Array.isArray(message.productGroupedResults)) + return "productGroupedResults: array expected"; + for (var i = 0; i < message.productGroupedResults.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.verify(message.productGroupedResults[i]); + if (error) + return "productGroupedResults." + error; + } + } + return null; + }; + + /** + * Creates a ProductSearchResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults} ProductSearchResults + */ + ProductSearchResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ProductSearchResults) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ProductSearchResults(); + if (object.indexTime != null) { + if (typeof object.indexTime !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.indexTime: object expected"); + message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.results: object expected"); + message.results[i] = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.fromObject(object.results[i]); + } + } + if (object.productGroupedResults) { + if (!Array.isArray(object.productGroupedResults)) + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.productGroupedResults: array expected"); + message.productGroupedResults = []; + for (var i = 0; i < object.productGroupedResults.length; ++i) { + if (typeof object.productGroupedResults[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.productGroupedResults: object expected"); + message.productGroupedResults[i] = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.fromObject(object.productGroupedResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProductSearchResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults} message ProductSearchResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSearchResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.productGroupedResults = []; + } + if (options.defaults) + object.indexTime = null; + if (message.indexTime != null && message.hasOwnProperty("indexTime")) + object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.toObject(message.results[j], options); + } + if (message.productGroupedResults && message.productGroupedResults.length) { + object.productGroupedResults = []; + for (var j = 0; j < message.productGroupedResults.length; ++j) + object.productGroupedResults[j] = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.toObject(message.productGroupedResults[j], options); + } + return object; + }; + + /** + * Converts this ProductSearchResults to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @instance + * @returns {Object.} JSON object + */ + ProductSearchResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ProductSearchResults.Result = (function() { + + /** + * Properties of a Result. + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @interface IResult + * @property {google.cloud.vision.v1p4beta1.IProduct|null} [product] Result product + * @property {number|null} [score] Result score + * @property {string|null} [image] Result image + */ + + /** + * Constructs a new Result. + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @classdesc Represents a Result. + * @implements IResult + * @constructor + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IResult=} [properties] Properties to set + */ + function Result(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]]; + } + + /** + * Result product. + * @member {google.cloud.vision.v1p4beta1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @instance + */ + Result.prototype.product = null; + + /** + * Result score. + * @member {number} score + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @instance + */ + Result.prototype.score = 0; + + /** + * Result image. + * @member {string} image + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @instance + */ + Result.prototype.image = ""; + + /** + * Creates a new Result instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IResult=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.Result} Result instance + */ + Result.create = function create(properties) { + return new Result(properties); + }; + + /** + * Encodes the specified Result message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.Result.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1p4beta1.Product.encode(message.product, 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); + if (message.image != null && message.hasOwnProperty("image")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.image); + return writer; + }; + + /** + * Encodes the specified Result message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.Result.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IResult} message Result message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Result.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Result message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.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.vision.v1p4beta1.ProductSearchResults.Result(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.vision.v1p4beta1.Product.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.image = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Result message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.Result} Result + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Result.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Result message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Result.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1p4beta1.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + return null; + }; + + /** + * Creates a Result message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.Result} Result + */ + Result.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.Result.product: object expected"); + message.product = $root.google.cloud.vision.v1p4beta1.Product.fromObject(object.product); + } + if (object.score != null) + message.score = Number(object.score); + if (object.image != null) + message.image = String(object.image); + return message; + }; + + /** + * Creates a plain object from a Result message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.Result} message Result + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Result.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.score = 0; + object.image = ""; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1p4beta1.Product.toObject(message.product, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + return object; + }; + + /** + * Converts this Result to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.Result + * @instance + * @returns {Object.} JSON object + */ + Result.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Result; + })(); + + ProductSearchResults.GroupedResult = (function() { + + /** + * Properties of a GroupedResult. + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @interface IGroupedResult + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingPoly] GroupedResult boundingPoly + * @property {Array.|null} [results] GroupedResult results + */ + + /** + * Constructs a new GroupedResult. + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults + * @classdesc Represents a GroupedResult. + * @implements IGroupedResult + * @constructor + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult=} [properties] Properties to set + */ + function GroupedResult(properties) { + this.results = []; + 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]]; + } + + /** + * GroupedResult boundingPoly. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @instance + */ + GroupedResult.prototype.boundingPoly = null; + + /** + * GroupedResult results. + * @member {Array.} results + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @instance + */ + GroupedResult.prototype.results = $util.emptyArray; + + /** + * Creates a new GroupedResult instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult} GroupedResult instance + */ + GroupedResult.create = function create(properties) { + return new GroupedResult(properties); + }; + + /** + * Encodes the specified GroupedResult message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult} message GroupedResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupedResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroupedResult message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.IGroupedResult} message GroupedResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupedResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupedResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult} GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupedResult.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.vision.v1p4beta1.ProductSearchResults.GroupedResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupedResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult} GroupedResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupedResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupedResult message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupedResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.verify(message.results[i]); + if (error) + return "results." + error; + } + } + return null; + }; + + /** + * Creates a GroupedResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult} GroupedResult + */ + GroupedResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult(); + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingPoly); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.results: object expected"); + message.results[i] = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.fromObject(object.results[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroupedResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult} message GroupedResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupedResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.boundingPoly = null; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.vision.v1p4beta1.ProductSearchResults.Result.toObject(message.results[j], options); + } + return object; + }; + + /** + * Converts this GroupedResult to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult + * @instance + * @returns {Object.} JSON object + */ + GroupedResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GroupedResult; + })(); + + return ProductSearchResults; + })(); + + v1p4beta1.ProductSearch = (function() { + + /** + * Constructs a new ProductSearch service. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ProductSearch + * @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 ProductSearch(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ProductSearch.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductSearch; + + /** + * Creates new ProductSearch service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @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 {ProductSearch} RPC service. Useful where requests and/or responses are streamed. + */ + ProductSearch.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#createProductSet}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef CreateProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ProductSet} [response] ProductSet + */ + + /** + * Calls CreateProductSet. + * @function createProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.ICreateProductSetRequest} request CreateProductSetRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.CreateProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createProductSet = function createProductSet(request, callback) { + return this.rpcCall(createProductSet, $root.google.cloud.vision.v1p4beta1.CreateProductSetRequest, $root.google.cloud.vision.v1p4beta1.ProductSet, request, callback); + }, "name", { value: "CreateProductSet" }); + + /** + * Calls CreateProductSet. + * @function createProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.ICreateProductSetRequest} request CreateProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listProductSets}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef ListProductSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ListProductSetsResponse} [response] ListProductSetsResponse + */ + + /** + * Calls ListProductSets. + * @function listProductSets + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListProductSetsRequest} request ListProductSetsRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.ListProductSetsCallback} callback Node-style callback called with the error, if any, and ListProductSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProductSets = function listProductSets(request, callback) { + return this.rpcCall(listProductSets, $root.google.cloud.vision.v1p4beta1.ListProductSetsRequest, $root.google.cloud.vision.v1p4beta1.ListProductSetsResponse, request, callback); + }, "name", { value: "ListProductSets" }); + + /** + * Calls ListProductSets. + * @function listProductSets + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListProductSetsRequest} request ListProductSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#getProductSet}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef GetProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ProductSet} [response] ProductSet + */ + + /** + * Calls GetProductSet. + * @function getProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IGetProductSetRequest} request GetProductSetRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.GetProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getProductSet = function getProductSet(request, callback) { + return this.rpcCall(getProductSet, $root.google.cloud.vision.v1p4beta1.GetProductSetRequest, $root.google.cloud.vision.v1p4beta1.ProductSet, request, callback); + }, "name", { value: "GetProductSet" }); + + /** + * Calls GetProductSet. + * @function getProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IGetProductSetRequest} request GetProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#updateProductSet}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef UpdateProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ProductSet} [response] ProductSet + */ + + /** + * Calls UpdateProductSet. + * @function updateProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IUpdateProductSetRequest} request UpdateProductSetRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.UpdateProductSetCallback} callback Node-style callback called with the error, if any, and ProductSet + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.updateProductSet = function updateProductSet(request, callback) { + return this.rpcCall(updateProductSet, $root.google.cloud.vision.v1p4beta1.UpdateProductSetRequest, $root.google.cloud.vision.v1p4beta1.ProductSet, request, callback); + }, "name", { value: "UpdateProductSet" }); + + /** + * Calls UpdateProductSet. + * @function updateProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IUpdateProductSetRequest} request UpdateProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#deleteProductSet}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef DeleteProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteProductSet. + * @function deleteProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IDeleteProductSetRequest} request DeleteProductSetRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.DeleteProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteProductSet = function deleteProductSet(request, callback) { + return this.rpcCall(deleteProductSet, $root.google.cloud.vision.v1p4beta1.DeleteProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProductSet" }); + + /** + * Calls DeleteProductSet. + * @function deleteProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IDeleteProductSetRequest} request DeleteProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#createProduct}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef CreateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.Product} [response] Product + */ + + /** + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.ICreateProductRequest} request CreateProductRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.CreateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createProduct = function createProduct(request, callback) { + return this.rpcCall(createProduct, $root.google.cloud.vision.v1p4beta1.CreateProductRequest, $root.google.cloud.vision.v1p4beta1.Product, request, callback); + }, "name", { value: "CreateProduct" }); + + /** + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.ICreateProductRequest} request CreateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listProducts}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef ListProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ListProductsResponse} [response] ListProductsResponse + */ + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListProductsRequest} request ListProductsRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProducts = function listProducts(request, callback) { + return this.rpcCall(listProducts, $root.google.cloud.vision.v1p4beta1.ListProductsRequest, $root.google.cloud.vision.v1p4beta1.ListProductsResponse, request, callback); + }, "name", { value: "ListProducts" }); + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListProductsRequest} request ListProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#getProduct}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef GetProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.Product} [response] Product + */ + + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IGetProductRequest} request GetProductRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.GetProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getProduct = function getProduct(request, callback) { + return this.rpcCall(getProduct, $root.google.cloud.vision.v1p4beta1.GetProductRequest, $root.google.cloud.vision.v1p4beta1.Product, request, callback); + }, "name", { value: "GetProduct" }); + + /** + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IGetProductRequest} request GetProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#updateProduct}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef UpdateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.Product} [response] Product + */ + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.updateProduct = function updateProduct(request, callback) { + return this.rpcCall(updateProduct, $root.google.cloud.vision.v1p4beta1.UpdateProductRequest, $root.google.cloud.vision.v1p4beta1.Product, request, callback); + }, "name", { value: "UpdateProduct" }); + + /** + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#deleteProduct}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef DeleteProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteProduct = function deleteProduct(request, callback) { + return this.rpcCall(deleteProduct, $root.google.cloud.vision.v1p4beta1.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProduct" }); + + /** + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#createReferenceImage}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef CreateReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ReferenceImage} [response] ReferenceImage + */ + + /** + * Calls CreateReferenceImage. + * @function createReferenceImage + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest} request CreateReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.CreateReferenceImageCallback} callback Node-style callback called with the error, if any, and ReferenceImage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.createReferenceImage = function createReferenceImage(request, callback) { + return this.rpcCall(createReferenceImage, $root.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest, $root.google.cloud.vision.v1p4beta1.ReferenceImage, request, callback); + }, "name", { value: "CreateReferenceImage" }); + + /** + * Calls CreateReferenceImage. + * @function createReferenceImage + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest} request CreateReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#deleteReferenceImage}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef DeleteReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteReferenceImage. + * @function deleteReferenceImage + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest} request DeleteReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.DeleteReferenceImageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.deleteReferenceImage = function deleteReferenceImage(request, callback) { + return this.rpcCall(deleteReferenceImage, $root.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteReferenceImage" }); + + /** + * Calls DeleteReferenceImage. + * @function deleteReferenceImage + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest} request DeleteReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listReferenceImages}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef ListReferenceImagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} [response] ListReferenceImagesResponse + */ + + /** + * Calls ListReferenceImages. + * @function listReferenceImages + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesRequest} request ListReferenceImagesRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.ListReferenceImagesCallback} callback Node-style callback called with the error, if any, and ListReferenceImagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listReferenceImages = function listReferenceImages(request, callback) { + return this.rpcCall(listReferenceImages, $root.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest, $root.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse, request, callback); + }, "name", { value: "ListReferenceImages" }); + + /** + * Calls ListReferenceImages. + * @function listReferenceImages + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesRequest} request ListReferenceImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#getReferenceImage}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef GetReferenceImageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ReferenceImage} [response] ReferenceImage + */ + + /** + * Calls GetReferenceImage. + * @function getReferenceImage + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IGetReferenceImageRequest} request GetReferenceImageRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.GetReferenceImageCallback} callback Node-style callback called with the error, if any, and ReferenceImage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.getReferenceImage = function getReferenceImage(request, callback) { + return this.rpcCall(getReferenceImage, $root.google.cloud.vision.v1p4beta1.GetReferenceImageRequest, $root.google.cloud.vision.v1p4beta1.ReferenceImage, request, callback); + }, "name", { value: "GetReferenceImage" }); + + /** + * Calls GetReferenceImage. + * @function getReferenceImage + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IGetReferenceImageRequest} request GetReferenceImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#addProductToProductSet}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef AddProductToProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls AddProductToProductSet. + * @function addProductToProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest} request AddProductToProductSetRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.AddProductToProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.addProductToProductSet = function addProductToProductSet(request, callback) { + return this.rpcCall(addProductToProductSet, $root.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "AddProductToProductSet" }); + + /** + * Calls AddProductToProductSet. + * @function addProductToProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest} request AddProductToProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#removeProductFromProductSet}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef RemoveProductFromProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls RemoveProductFromProductSet. + * @function removeProductFromProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest} request RemoveProductFromProductSetRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.RemoveProductFromProductSetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.removeProductFromProductSet = function removeProductFromProductSet(request, callback) { + return this.rpcCall(removeProductFromProductSet, $root.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "RemoveProductFromProductSet" }); + + /** + * Calls RemoveProductFromProductSet. + * @function removeProductFromProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest} request RemoveProductFromProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#listProductsInProductSet}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef ListProductsInProductSetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} [response] ListProductsInProductSetResponse + */ + + /** + * Calls ListProductsInProductSet. + * @function listProductsInProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest} request ListProductsInProductSetRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.ListProductsInProductSetCallback} callback Node-style callback called with the error, if any, and ListProductsInProductSetResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.listProductsInProductSet = function listProductsInProductSet(request, callback) { + return this.rpcCall(listProductsInProductSet, $root.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest, $root.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse, request, callback); + }, "name", { value: "ListProductsInProductSet" }); + + /** + * Calls ListProductsInProductSet. + * @function listProductsInProductSet + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest} request ListProductsInProductSetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vision.v1p4beta1.ProductSearch#importProductSets}. + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @typedef ImportProductSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportProductSets. + * @function importProductSets + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsRequest} request ImportProductSetsRequest message or plain object + * @param {google.cloud.vision.v1p4beta1.ProductSearch.ImportProductSetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductSearch.prototype.importProductSets = function importProductSets(request, callback) { + return this.rpcCall(importProductSets, $root.google.cloud.vision.v1p4beta1.ImportProductSetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportProductSets" }); + + /** + * Calls ImportProductSets. + * @function importProductSets + * @memberof google.cloud.vision.v1p4beta1.ProductSearch + * @instance + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsRequest} request ImportProductSetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProductSearch; + })(); + + v1p4beta1.Product = (function() { + + /** + * Properties of a Product. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IProduct + * @property {string|null} [name] Product name + * @property {string|null} [displayName] Product displayName + * @property {string|null} [description] Product description + * @property {string|null} [productCategory] Product productCategory + * @property {Array.|null} [productLabels] Product productLabels + */ + + /** + * Constructs a new Product. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Product. + * @implements IProduct + * @constructor + * @param {google.cloud.vision.v1p4beta1.IProduct=} [properties] Properties to set + */ + function Product(properties) { + this.productLabels = []; + 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]]; + } + + /** + * Product name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.Product + * @instance + */ + Product.prototype.name = ""; + + /** + * Product displayName. + * @member {string} displayName + * @memberof google.cloud.vision.v1p4beta1.Product + * @instance + */ + Product.prototype.displayName = ""; + + /** + * Product description. + * @member {string} description + * @memberof google.cloud.vision.v1p4beta1.Product + * @instance + */ + Product.prototype.description = ""; + + /** + * Product productCategory. + * @member {string} productCategory + * @memberof google.cloud.vision.v1p4beta1.Product + * @instance + */ + Product.prototype.productCategory = ""; + + /** + * Product productLabels. + * @member {Array.} productLabels + * @memberof google.cloud.vision.v1p4beta1.Product + * @instance + */ + Product.prototype.productLabels = $util.emptyArray; + + /** + * Creates a new Product instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {google.cloud.vision.v1p4beta1.IProduct=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Product} Product instance + */ + Product.create = function create(properties) { + return new Product(properties); + }; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {google.cloud.vision.v1p4beta1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.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.productCategory != null && message.hasOwnProperty("productCategory")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.productCategory); + if (message.productLabels != null && message.productLabels.length) + for (var i = 0; i < message.productLabels.length; ++i) + $root.google.cloud.vision.v1p4beta1.Product.KeyValue.encode(message.productLabels[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {google.cloud.vision.v1p4beta1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Product message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.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.vision.v1p4beta1.Product(); + 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 3: + message.description = reader.string(); + break; + case 4: + message.productCategory = reader.string(); + break; + case 5: + if (!(message.productLabels && message.productLabels.length)) + message.productLabels = []; + message.productLabels.push($root.google.cloud.vision.v1p4beta1.Product.KeyValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Product message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Product.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.productCategory != null && message.hasOwnProperty("productCategory")) + if (!$util.isString(message.productCategory)) + return "productCategory: string expected"; + if (message.productLabels != null && message.hasOwnProperty("productLabels")) { + if (!Array.isArray(message.productLabels)) + return "productLabels: array expected"; + for (var i = 0; i < message.productLabels.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Product.KeyValue.verify(message.productLabels[i]); + if (error) + return "productLabels." + error; + } + } + return null; + }; + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Product} Product + */ + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Product) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Product(); + 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.productCategory != null) + message.productCategory = String(object.productCategory); + if (object.productLabels) { + if (!Array.isArray(object.productLabels)) + throw TypeError(".google.cloud.vision.v1p4beta1.Product.productLabels: array expected"); + message.productLabels = []; + for (var i = 0; i < object.productLabels.length; ++i) { + if (typeof object.productLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Product.productLabels: object expected"); + message.productLabels[i] = $root.google.cloud.vision.v1p4beta1.Product.KeyValue.fromObject(object.productLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Product + * @static + * @param {google.cloud.vision.v1p4beta1.Product} message Product + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Product.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productLabels = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.productCategory = ""; + } + 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.productCategory != null && message.hasOwnProperty("productCategory")) + object.productCategory = message.productCategory; + if (message.productLabels && message.productLabels.length) { + object.productLabels = []; + for (var j = 0; j < message.productLabels.length; ++j) + object.productLabels[j] = $root.google.cloud.vision.v1p4beta1.Product.KeyValue.toObject(message.productLabels[j], options); + } + return object; + }; + + /** + * Converts this Product to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Product + * @instance + * @returns {Object.} JSON object + */ + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Product.KeyValue = (function() { + + /** + * Properties of a KeyValue. + * @memberof google.cloud.vision.v1p4beta1.Product + * @interface IKeyValue + * @property {string|null} [key] KeyValue key + * @property {string|null} [value] KeyValue value + */ + + /** + * Constructs a new KeyValue. + * @memberof google.cloud.vision.v1p4beta1.Product + * @classdesc Represents a KeyValue. + * @implements IKeyValue + * @constructor + * @param {google.cloud.vision.v1p4beta1.Product.IKeyValue=} [properties] Properties to set + */ + function KeyValue(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]]; + } + + /** + * KeyValue key. + * @member {string} key + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @instance + */ + KeyValue.prototype.key = ""; + + /** + * KeyValue value. + * @member {string} value + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @instance + */ + KeyValue.prototype.value = ""; + + /** + * Creates a new KeyValue instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p4beta1.Product.IKeyValue=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Product.KeyValue} KeyValue instance + */ + KeyValue.create = function create(properties) { + return new KeyValue(properties); + }; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.KeyValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p4beta1.Product.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && message.hasOwnProperty("key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Product.KeyValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p4beta1.Product.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Product.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.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.vision.v1p4beta1.Product.KeyValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Product.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyValue message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Product.KeyValue} KeyValue + */ + KeyValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Product.KeyValue) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Product.KeyValue(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @static + * @param {google.cloud.vision.v1p4beta1.Product.KeyValue} message KeyValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this KeyValue to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Product.KeyValue + * @instance + * @returns {Object.} JSON object + */ + KeyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KeyValue; + })(); + + return Product; + })(); + + v1p4beta1.ProductSet = (function() { + + /** + * Properties of a ProductSet. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IProductSet + * @property {string|null} [name] ProductSet name + * @property {string|null} [displayName] ProductSet displayName + * @property {google.protobuf.ITimestamp|null} [indexTime] ProductSet indexTime + * @property {google.rpc.IStatus|null} [indexError] ProductSet indexError + */ + + /** + * Constructs a new ProductSet. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ProductSet. + * @implements IProductSet + * @constructor + * @param {google.cloud.vision.v1p4beta1.IProductSet=} [properties] Properties to set + */ + function ProductSet(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]]; + } + + /** + * ProductSet name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @instance + */ + ProductSet.prototype.name = ""; + + /** + * ProductSet displayName. + * @member {string} displayName + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @instance + */ + ProductSet.prototype.displayName = ""; + + /** + * ProductSet indexTime. + * @member {google.protobuf.ITimestamp|null|undefined} indexTime + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @instance + */ + ProductSet.prototype.indexTime = null; + + /** + * ProductSet indexError. + * @member {google.rpc.IStatus|null|undefined} indexError + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @instance + */ + ProductSet.prototype.indexError = null; + + /** + * Creates a new ProductSet instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSet=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ProductSet} ProductSet instance + */ + ProductSet.create = function create(properties) { + return new ProductSet(properties); + }; + + /** + * Encodes the specified ProductSet message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSet} message ProductSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSet.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.indexTime != null && message.hasOwnProperty("indexTime")) + $root.google.protobuf.Timestamp.encode(message.indexTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.indexError != null && message.hasOwnProperty("indexError")) + $root.google.rpc.Status.encode(message.indexError, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductSet message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ProductSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p4beta1.IProductSet} message ProductSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ProductSet} ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSet.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.vision.v1p4beta1.ProductSet(); + 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 3: + message.indexTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.indexError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ProductSet} ProductSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSet message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSet.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.indexTime != null && message.hasOwnProperty("indexTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.indexTime); + if (error) + return "indexTime." + error; + } + if (message.indexError != null && message.hasOwnProperty("indexError")) { + var error = $root.google.rpc.Status.verify(message.indexError); + if (error) + return "indexError." + error; + } + return null; + }; + + /** + * Creates a ProductSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ProductSet} ProductSet + */ + ProductSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ProductSet) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ProductSet(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.indexTime != null) { + if (typeof object.indexTime !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSet.indexTime: object expected"); + message.indexTime = $root.google.protobuf.Timestamp.fromObject(object.indexTime); + } + if (object.indexError != null) { + if (typeof object.indexError !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ProductSet.indexError: object expected"); + message.indexError = $root.google.rpc.Status.fromObject(object.indexError); + } + return message; + }; + + /** + * Creates a plain object from a ProductSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @static + * @param {google.cloud.vision.v1p4beta1.ProductSet} message ProductSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.indexTime = null; + object.indexError = 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.indexTime != null && message.hasOwnProperty("indexTime")) + object.indexTime = $root.google.protobuf.Timestamp.toObject(message.indexTime, options); + if (message.indexError != null && message.hasOwnProperty("indexError")) + object.indexError = $root.google.rpc.Status.toObject(message.indexError, options); + return object; + }; + + /** + * Converts this ProductSet to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ProductSet + * @instance + * @returns {Object.} JSON object + */ + ProductSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSet; + })(); + + v1p4beta1.ReferenceImage = (function() { + + /** + * Properties of a ReferenceImage. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IReferenceImage + * @property {string|null} [name] ReferenceImage name + * @property {string|null} [uri] ReferenceImage uri + * @property {Array.|null} [boundingPolys] ReferenceImage boundingPolys + */ + + /** + * Constructs a new ReferenceImage. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ReferenceImage. + * @implements IReferenceImage + * @constructor + * @param {google.cloud.vision.v1p4beta1.IReferenceImage=} [properties] Properties to set + */ + function ReferenceImage(properties) { + this.boundingPolys = []; + 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]]; + } + + /** + * ReferenceImage name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.name = ""; + + /** + * ReferenceImage uri. + * @member {string} uri + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.uri = ""; + + /** + * ReferenceImage boundingPolys. + * @member {Array.} boundingPolys + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @instance + */ + ReferenceImage.prototype.boundingPolys = $util.emptyArray; + + /** + * Creates a new ReferenceImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p4beta1.IReferenceImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ReferenceImage} ReferenceImage instance + */ + ReferenceImage.create = function create(properties) { + return new ReferenceImage(properties); + }; + + /** + * Encodes the specified ReferenceImage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ReferenceImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p4beta1.IReferenceImage} message ReferenceImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferenceImage.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.uri != null && message.hasOwnProperty("uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.boundingPolys != null && message.boundingPolys.length) + for (var i = 0; i < message.boundingPolys.length; ++i) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingPolys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReferenceImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ReferenceImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p4beta1.IReferenceImage} message ReferenceImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReferenceImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ReferenceImage} ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferenceImage.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.vision.v1p4beta1.ReferenceImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + case 3: + if (!(message.boundingPolys && message.boundingPolys.length)) + message.boundingPolys = []; + message.boundingPolys.push($root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReferenceImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ReferenceImage} ReferenceImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReferenceImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReferenceImage message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReferenceImage.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.boundingPolys != null && message.hasOwnProperty("boundingPolys")) { + if (!Array.isArray(message.boundingPolys)) + return "boundingPolys: array expected"; + for (var i = 0; i < message.boundingPolys.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingPolys[i]); + if (error) + return "boundingPolys." + error; + } + } + return null; + }; + + /** + * Creates a ReferenceImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ReferenceImage} ReferenceImage + */ + ReferenceImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ReferenceImage) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ReferenceImage(); + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.boundingPolys) { + if (!Array.isArray(object.boundingPolys)) + throw TypeError(".google.cloud.vision.v1p4beta1.ReferenceImage.boundingPolys: array expected"); + message.boundingPolys = []; + for (var i = 0; i < object.boundingPolys.length; ++i) { + if (typeof object.boundingPolys[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ReferenceImage.boundingPolys: object expected"); + message.boundingPolys[i] = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingPolys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReferenceImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @static + * @param {google.cloud.vision.v1p4beta1.ReferenceImage} message ReferenceImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReferenceImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingPolys = []; + if (options.defaults) { + object.name = ""; + object.uri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.boundingPolys && message.boundingPolys.length) { + object.boundingPolys = []; + for (var j = 0; j < message.boundingPolys.length; ++j) + object.boundingPolys[j] = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingPolys[j], options); + } + return object; + }; + + /** + * Converts this ReferenceImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ReferenceImage + * @instance + * @returns {Object.} JSON object + */ + ReferenceImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReferenceImage; + })(); + + v1p4beta1.CreateProductRequest = (function() { + + /** + * Properties of a CreateProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ICreateProductRequest + * @property {string|null} [parent] CreateProductRequest parent + * @property {google.cloud.vision.v1p4beta1.IProduct|null} [product] CreateProductRequest product + * @property {string|null} [productId] CreateProductRequest productId + */ + + /** + * Constructs a new CreateProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a CreateProductRequest. + * @implements ICreateProductRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.ICreateProductRequest=} [properties] Properties to set + */ + function CreateProductRequest(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]]; + } + + /** + * CreateProductRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.parent = ""; + + /** + * CreateProductRequest product. + * @member {google.cloud.vision.v1p4beta1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.product = null; + + /** + * CreateProductRequest productId. + * @member {string} productId + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @instance + */ + CreateProductRequest.prototype.productId = ""; + + /** + * Creates a new CreateProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.CreateProductRequest} CreateProductRequest instance + */ + CreateProductRequest.create = function create(properties) { + return new CreateProductRequest(properties); + }; + + /** + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductRequest.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.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1p4beta1.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productId != null && message.hasOwnProperty("productId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); + return writer; + }; + + /** + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.CreateProductRequest} CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductRequest.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.vision.v1p4beta1.CreateProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.product = $root.google.cloud.vision.v1p4beta1.Product.decode(reader, reader.uint32()); + break; + case 3: + message.productId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.CreateProductRequest} CreateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProductRequest.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.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1p4beta1.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + return null; + }; + + /** + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.CreateProductRequest} CreateProductRequest + */ + CreateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.CreateProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.CreateProductRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.CreateProductRequest.product: object expected"); + message.product = $root.google.cloud.vision.v1p4beta1.Product.fromObject(object.product); + } + if (object.productId != null) + message.productId = String(object.productId); + return message; + }; + + /** + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.CreateProductRequest} message CreateProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.product = null; + object.productId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1p4beta1.Product.toObject(message.product, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + return object; + }; + + /** + * Converts this CreateProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.CreateProductRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateProductRequest; + })(); + + v1p4beta1.ListProductsRequest = (function() { + + /** + * Properties of a ListProductsRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListProductsRequest + * @property {string|null} [parent] ListProductsRequest parent + * @property {number|null} [pageSize] ListProductsRequest pageSize + * @property {string|null} [pageToken] ListProductsRequest pageToken + */ + + /** + * Constructs a new ListProductsRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListProductsRequest. + * @implements IListProductsRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListProductsRequest=} [properties] Properties to set + */ + function ListProductsRequest(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]]; + } + + /** + * ListProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.parent = ""; + + /** + * ListProductsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageSize = 0; + + /** + * ListProductsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListProductsRequest} ListProductsRequest instance + */ + ListProductsRequest.create = function create(properties) { + return new ListProductsRequest(properties); + }; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.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.vision.v1p4beta1.ListProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsRequest.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.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 ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListProductsRequest} ListProductsRequest + */ + ListProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListProductsRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ListProductsRequest} message ListProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListProductsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsRequest; + })(); + + v1p4beta1.ListProductsResponse = (function() { + + /** + * Properties of a ListProductsResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListProductsResponse + * @property {Array.|null} [products] ListProductsResponse products + * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken + */ + + /** + * Constructs a new ListProductsResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListProductsResponse. + * @implements IListProductsResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListProductsResponse=} [properties] Properties to set + */ + function ListProductsResponse(properties) { + this.products = []; + 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]]; + } + + /** + * ListProductsResponse products. + * @member {Array.} products + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.products = $util.emptyArray; + + /** + * ListProductsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListProductsResponse} ListProductsResponse instance + */ + ListProductsResponse.create = function create(properties) { + return new ListProductsResponse(properties); + }; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.vision.v1p4beta1.Product.encode(message.products[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 ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.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.vision.v1p4beta1.ListProductsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.vision.v1p4beta1.Product.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListProductsResponse} ListProductsResponse + */ + ListProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListProductsResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListProductsResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.vision.v1p4beta1.ListProductsResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ListProductsResponse.products: object expected"); + message.products[i] = $root.google.cloud.vision.v1p4beta1.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.ListProductsResponse} message ListProductsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.vision.v1p4beta1.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListProductsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsResponse; + })(); + + v1p4beta1.GetProductRequest = (function() { + + /** + * Properties of a GetProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IGetProductRequest + * @property {string|null} [name] GetProductRequest name + */ + + /** + * Constructs a new GetProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a GetProductRequest. + * @implements IGetProductRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IGetProductRequest=} [properties] Properties to set + */ + function GetProductRequest(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]]; + } + + /** + * GetProductRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @instance + */ + GetProductRequest.prototype.name = ""; + + /** + * Creates a new GetProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.GetProductRequest} GetProductRequest instance + */ + GetProductRequest.create = function create(properties) { + return new GetProductRequest(properties); + }; + + /** + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductRequest.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 GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductRequest.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.vision.v1p4beta1.GetProductRequest(); + 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 GetProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.GetProductRequest} GetProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProductRequest.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 GetProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.GetProductRequest} GetProductRequest + */ + GetProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.GetProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.GetProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.GetProductRequest} message GetProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProductRequest.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 GetProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.GetProductRequest + * @instance + * @returns {Object.} JSON object + */ + GetProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProductRequest; + })(); + + v1p4beta1.UpdateProductRequest = (function() { + + /** + * Properties of an UpdateProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IUpdateProductRequest + * @property {google.cloud.vision.v1p4beta1.IProduct|null} [product] UpdateProductRequest product + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask + */ + + /** + * Constructs a new UpdateProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an UpdateProductRequest. + * @implements IUpdateProductRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IUpdateProductRequest=} [properties] Properties to set + */ + function UpdateProductRequest(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]]; + } + + /** + * UpdateProductRequest product. + * @member {google.cloud.vision.v1p4beta1.IProduct|null|undefined} product + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @instance + */ + UpdateProductRequest.prototype.product = null; + + /** + * UpdateProductRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @instance + */ + UpdateProductRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IUpdateProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.UpdateProductRequest} UpdateProductRequest instance + */ + UpdateProductRequest.create = function create(properties) { + return new UpdateProductRequest(properties); + }; + + /** + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && message.hasOwnProperty("product")) + $root.google.cloud.vision.v1p4beta1.Product.encode(message.product, 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 UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductRequest.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.vision.v1p4beta1.UpdateProductRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.product = $root.google.cloud.vision.v1p4beta1.Product.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.UpdateProductRequest} UpdateProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProductRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.vision.v1p4beta1.Product.verify(message.product); + if (error) + return "product." + 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.UpdateProductRequest} UpdateProductRequest + */ + UpdateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.UpdateProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.UpdateProductRequest(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.UpdateProductRequest.product: object expected"); + message.product = $root.google.cloud.vision.v1p4beta1.Product.fromObject(object.product); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.UpdateProductRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.UpdateProductRequest} message UpdateProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProductRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.product = null; + object.updateMask = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.vision.v1p4beta1.Product.toObject(message.product, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.UpdateProductRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateProductRequest; + })(); + + v1p4beta1.DeleteProductRequest = (function() { + + /** + * Properties of a DeleteProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IDeleteProductRequest + * @property {string|null} [name] DeleteProductRequest name + */ + + /** + * Constructs a new DeleteProductRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a DeleteProductRequest. + * @implements IDeleteProductRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IDeleteProductRequest=} [properties] Properties to set + */ + function DeleteProductRequest(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]]; + } + + /** + * DeleteProductRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @instance + */ + DeleteProductRequest.prototype.name = ""; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteProductRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.DeleteProductRequest} DeleteProductRequest instance + */ + DeleteProductRequest.create = function create(properties) { + return new DeleteProductRequest(properties); + }; + + /** + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductRequest.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 DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProductRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.DeleteProductRequest} DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductRequest.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.vision.v1p4beta1.DeleteProductRequest(); + 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 DeleteProductRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.DeleteProductRequest} DeleteProductRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProductRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProductRequest.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 DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.DeleteProductRequest} DeleteProductRequest + */ + DeleteProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.DeleteProductRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.DeleteProductRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @static + * @param {google.cloud.vision.v1p4beta1.DeleteProductRequest} message DeleteProductRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProductRequest.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 DeleteProductRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.DeleteProductRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProductRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteProductRequest; + })(); + + v1p4beta1.CreateProductSetRequest = (function() { + + /** + * Properties of a CreateProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ICreateProductSetRequest + * @property {string|null} [parent] CreateProductSetRequest parent + * @property {google.cloud.vision.v1p4beta1.IProductSet|null} [productSet] CreateProductSetRequest productSet + * @property {string|null} [productSetId] CreateProductSetRequest productSetId + */ + + /** + * Constructs a new CreateProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a CreateProductSetRequest. + * @implements ICreateProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.ICreateProductSetRequest=} [properties] Properties to set + */ + function CreateProductSetRequest(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]]; + } + + /** + * CreateProductSetRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.parent = ""; + + /** + * CreateProductSetRequest productSet. + * @member {google.cloud.vision.v1p4beta1.IProductSet|null|undefined} productSet + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.productSet = null; + + /** + * CreateProductSetRequest productSetId. + * @member {string} productSetId + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @instance + */ + CreateProductSetRequest.prototype.productSetId = ""; + + /** + * Creates a new CreateProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.CreateProductSetRequest} CreateProductSetRequest instance + */ + CreateProductSetRequest.create = function create(properties) { + return new CreateProductSetRequest(properties); + }; + + /** + * Encodes the specified CreateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateProductSetRequest} message CreateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductSetRequest.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.productSet != null && message.hasOwnProperty("productSet")) + $root.google.cloud.vision.v1p4beta1.ProductSet.encode(message.productSet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productSetId); + return writer; + }; + + /** + * Encodes the specified CreateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateProductSetRequest} message CreateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.CreateProductSetRequest} CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductSetRequest.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.vision.v1p4beta1.CreateProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.productSet = $root.google.cloud.vision.v1p4beta1.ProductSet.decode(reader, reader.uint32()); + break; + case 3: + message.productSetId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.CreateProductSetRequest} CreateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProductSetRequest.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.productSet != null && message.hasOwnProperty("productSet")) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSet.verify(message.productSet); + if (error) + return "productSet." + error; + } + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + if (!$util.isString(message.productSetId)) + return "productSetId: string expected"; + return null; + }; + + /** + * Creates a CreateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.CreateProductSetRequest} CreateProductSetRequest + */ + CreateProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.CreateProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.CreateProductSetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.productSet != null) { + if (typeof object.productSet !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.CreateProductSetRequest.productSet: object expected"); + message.productSet = $root.google.cloud.vision.v1p4beta1.ProductSet.fromObject(object.productSet); + } + if (object.productSetId != null) + message.productSetId = String(object.productSetId); + return message; + }; + + /** + * Creates a plain object from a CreateProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.CreateProductSetRequest} message CreateProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.productSet = null; + object.productSetId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = $root.google.cloud.vision.v1p4beta1.ProductSet.toObject(message.productSet, options); + if (message.productSetId != null && message.hasOwnProperty("productSetId")) + object.productSetId = message.productSetId; + return object; + }; + + /** + * Converts this CreateProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.CreateProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateProductSetRequest; + })(); + + v1p4beta1.ListProductSetsRequest = (function() { + + /** + * Properties of a ListProductSetsRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListProductSetsRequest + * @property {string|null} [parent] ListProductSetsRequest parent + * @property {number|null} [pageSize] ListProductSetsRequest pageSize + * @property {string|null} [pageToken] ListProductSetsRequest pageToken + */ + + /** + * Constructs a new ListProductSetsRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListProductSetsRequest. + * @implements IListProductSetsRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListProductSetsRequest=} [properties] Properties to set + */ + function ListProductSetsRequest(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]]; + } + + /** + * ListProductSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.parent = ""; + + /** + * ListProductSetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.pageSize = 0; + + /** + * ListProductSetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @instance + */ + ListProductSetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductSetsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsRequest} ListProductSetsRequest instance + */ + ListProductSetsRequest.create = function create(properties) { + return new ListProductSetsRequest(properties); + }; + + /** + * Encodes the specified ListProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductSetsRequest} message ListProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductSetsRequest} message ListProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsRequest} ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsRequest.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.vision.v1p4beta1.ListProductSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsRequest} ListProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductSetsRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductSetsRequest.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.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 ListProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsRequest} ListProductSetsRequest + */ + ListProductSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListProductSetsRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListProductSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ListProductSetsRequest} message ListProductSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProductSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductSetsRequest; + })(); + + v1p4beta1.ListProductSetsResponse = (function() { + + /** + * Properties of a ListProductSetsResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListProductSetsResponse + * @property {Array.|null} [productSets] ListProductSetsResponse productSets + * @property {string|null} [nextPageToken] ListProductSetsResponse nextPageToken + */ + + /** + * Constructs a new ListProductSetsResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListProductSetsResponse. + * @implements IListProductSetsResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListProductSetsResponse=} [properties] Properties to set + */ + function ListProductSetsResponse(properties) { + this.productSets = []; + 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]]; + } + + /** + * ListProductSetsResponse productSets. + * @member {Array.} productSets + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @instance + */ + ListProductSetsResponse.prototype.productSets = $util.emptyArray; + + /** + * ListProductSetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @instance + */ + ListProductSetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductSetsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsResponse} ListProductSetsResponse instance + */ + ListProductSetsResponse.create = function create(properties) { + return new ListProductSetsResponse(properties); + }; + + /** + * Encodes the specified ListProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductSetsResponse} message ListProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSets != null && message.productSets.length) + for (var i = 0; i < message.productSets.length; ++i) + $root.google.cloud.vision.v1p4beta1.ProductSet.encode(message.productSets[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 ListProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductSetsResponse} message ListProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsResponse} ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsResponse.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.vision.v1p4beta1.ListProductSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.productSets && message.productSets.length)) + message.productSets = []; + message.productSets.push($root.google.cloud.vision.v1p4beta1.ProductSet.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsResponse} ListProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductSetsResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productSets != null && message.hasOwnProperty("productSets")) { + if (!Array.isArray(message.productSets)) + return "productSets: array expected"; + for (var i = 0; i < message.productSets.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSet.verify(message.productSets[i]); + if (error) + return "productSets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListProductSetsResponse} ListProductSetsResponse + */ + ListProductSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListProductSetsResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListProductSetsResponse(); + if (object.productSets) { + if (!Array.isArray(object.productSets)) + throw TypeError(".google.cloud.vision.v1p4beta1.ListProductSetsResponse.productSets: array expected"); + message.productSets = []; + for (var i = 0; i < object.productSets.length; ++i) { + if (typeof object.productSets[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ListProductSetsResponse.productSets: object expected"); + message.productSets[i] = $root.google.cloud.vision.v1p4beta1.ProductSet.fromObject(object.productSets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.ListProductSetsResponse} message ListProductSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.productSets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.productSets && message.productSets.length) { + object.productSets = []; + for (var j = 0; j < message.productSets.length; ++j) + object.productSets[j] = $root.google.cloud.vision.v1p4beta1.ProductSet.toObject(message.productSets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListProductSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductSetsResponse; + })(); + + v1p4beta1.GetProductSetRequest = (function() { + + /** + * Properties of a GetProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IGetProductSetRequest + * @property {string|null} [name] GetProductSetRequest name + */ + + /** + * Constructs a new GetProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a GetProductSetRequest. + * @implements IGetProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IGetProductSetRequest=} [properties] Properties to set + */ + function GetProductSetRequest(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]]; + } + + /** + * GetProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @instance + */ + GetProductSetRequest.prototype.name = ""; + + /** + * Creates a new GetProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.GetProductSetRequest} GetProductSetRequest instance + */ + GetProductSetRequest.create = function create(properties) { + return new GetProductSetRequest(properties); + }; + + /** + * Encodes the specified GetProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetProductSetRequest} message GetProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductSetRequest.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 GetProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetProductSetRequest} message GetProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.GetProductSetRequest} GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductSetRequest.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.vision.v1p4beta1.GetProductSetRequest(); + 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 GetProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.GetProductSetRequest} GetProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProductSetRequest.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 GetProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.GetProductSetRequest} GetProductSetRequest + */ + GetProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.GetProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.GetProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.GetProductSetRequest} message GetProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProductSetRequest.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 GetProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.GetProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + GetProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProductSetRequest; + })(); + + v1p4beta1.UpdateProductSetRequest = (function() { + + /** + * Properties of an UpdateProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IUpdateProductSetRequest + * @property {google.cloud.vision.v1p4beta1.IProductSet|null} [productSet] UpdateProductSetRequest productSet + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductSetRequest updateMask + */ + + /** + * Constructs a new UpdateProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an UpdateProductSetRequest. + * @implements IUpdateProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IUpdateProductSetRequest=} [properties] Properties to set + */ + function UpdateProductSetRequest(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]]; + } + + /** + * UpdateProductSetRequest productSet. + * @member {google.cloud.vision.v1p4beta1.IProductSet|null|undefined} productSet + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @instance + */ + UpdateProductSetRequest.prototype.productSet = null; + + /** + * UpdateProductSetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @instance + */ + UpdateProductSetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IUpdateProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.UpdateProductSetRequest} UpdateProductSetRequest instance + */ + UpdateProductSetRequest.create = function create(properties) { + return new UpdateProductSetRequest(properties); + }; + + /** + * Encodes the specified UpdateProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IUpdateProductSetRequest} message UpdateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductSetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productSet != null && message.hasOwnProperty("productSet")) + $root.google.cloud.vision.v1p4beta1.ProductSet.encode(message.productSet, 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 UpdateProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.UpdateProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IUpdateProductSetRequest} message UpdateProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.UpdateProductSetRequest} UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductSetRequest.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.vision.v1p4beta1.UpdateProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productSet = $root.google.cloud.vision.v1p4beta1.ProductSet.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.UpdateProductSetRequest} UpdateProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProductSetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productSet != null && message.hasOwnProperty("productSet")) { + var error = $root.google.cloud.vision.v1p4beta1.ProductSet.verify(message.productSet); + if (error) + return "productSet." + 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 UpdateProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.UpdateProductSetRequest} UpdateProductSetRequest + */ + UpdateProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.UpdateProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.UpdateProductSetRequest(); + if (object.productSet != null) { + if (typeof object.productSet !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.UpdateProductSetRequest.productSet: object expected"); + message.productSet = $root.google.cloud.vision.v1p4beta1.ProductSet.fromObject(object.productSet); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.UpdateProductSetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.UpdateProductSetRequest} message UpdateProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.productSet = null; + object.updateMask = null; + } + if (message.productSet != null && message.hasOwnProperty("productSet")) + object.productSet = $root.google.cloud.vision.v1p4beta1.ProductSet.toObject(message.productSet, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.UpdateProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateProductSetRequest; + })(); + + v1p4beta1.DeleteProductSetRequest = (function() { + + /** + * Properties of a DeleteProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IDeleteProductSetRequest + * @property {string|null} [name] DeleteProductSetRequest name + */ + + /** + * Constructs a new DeleteProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a DeleteProductSetRequest. + * @implements IDeleteProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IDeleteProductSetRequest=} [properties] Properties to set + */ + function DeleteProductSetRequest(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]]; + } + + /** + * DeleteProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @instance + */ + DeleteProductSetRequest.prototype.name = ""; + + /** + * Creates a new DeleteProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.DeleteProductSetRequest} DeleteProductSetRequest instance + */ + DeleteProductSetRequest.create = function create(properties) { + return new DeleteProductSetRequest(properties); + }; + + /** + * Encodes the specified DeleteProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteProductSetRequest} message DeleteProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductSetRequest.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 DeleteProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteProductSetRequest} message DeleteProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.DeleteProductSetRequest} DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductSetRequest.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.vision.v1p4beta1.DeleteProductSetRequest(); + 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 DeleteProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.DeleteProductSetRequest} DeleteProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProductSetRequest.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 DeleteProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.DeleteProductSetRequest} DeleteProductSetRequest + */ + DeleteProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.DeleteProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.DeleteProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.DeleteProductSetRequest} message DeleteProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProductSetRequest.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 DeleteProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.DeleteProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteProductSetRequest; + })(); + + v1p4beta1.CreateReferenceImageRequest = (function() { + + /** + * Properties of a CreateReferenceImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ICreateReferenceImageRequest + * @property {string|null} [parent] CreateReferenceImageRequest parent + * @property {google.cloud.vision.v1p4beta1.IReferenceImage|null} [referenceImage] CreateReferenceImageRequest referenceImage + * @property {string|null} [referenceImageId] CreateReferenceImageRequest referenceImageId + */ + + /** + * Constructs a new CreateReferenceImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a CreateReferenceImageRequest. + * @implements ICreateReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest=} [properties] Properties to set + */ + function CreateReferenceImageRequest(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]]; + } + + /** + * CreateReferenceImageRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.parent = ""; + + /** + * CreateReferenceImageRequest referenceImage. + * @member {google.cloud.vision.v1p4beta1.IReferenceImage|null|undefined} referenceImage + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.referenceImage = null; + + /** + * CreateReferenceImageRequest referenceImageId. + * @member {string} referenceImageId + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @instance + */ + CreateReferenceImageRequest.prototype.referenceImageId = ""; + + /** + * Creates a new CreateReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.CreateReferenceImageRequest} CreateReferenceImageRequest instance + */ + CreateReferenceImageRequest.create = function create(properties) { + return new CreateReferenceImageRequest(properties); + }; + + /** + * Encodes the specified CreateReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest} message CreateReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReferenceImageRequest.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.referenceImage != null && message.hasOwnProperty("referenceImage")) + $root.google.cloud.vision.v1p4beta1.ReferenceImage.encode(message.referenceImage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.referenceImageId); + return writer; + }; + + /** + * Encodes the specified CreateReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ICreateReferenceImageRequest} message CreateReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.CreateReferenceImageRequest} CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReferenceImageRequest.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.vision.v1p4beta1.CreateReferenceImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.referenceImage = $root.google.cloud.vision.v1p4beta1.ReferenceImage.decode(reader, reader.uint32()); + break; + case 3: + message.referenceImageId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.CreateReferenceImageRequest} CreateReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReferenceImageRequest.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.referenceImage != null && message.hasOwnProperty("referenceImage")) { + var error = $root.google.cloud.vision.v1p4beta1.ReferenceImage.verify(message.referenceImage); + if (error) + return "referenceImage." + error; + } + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + if (!$util.isString(message.referenceImageId)) + return "referenceImageId: string expected"; + return null; + }; + + /** + * Creates a CreateReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.CreateReferenceImageRequest} CreateReferenceImageRequest + */ + CreateReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.referenceImage != null) { + if (typeof object.referenceImage !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.referenceImage: object expected"); + message.referenceImage = $root.google.cloud.vision.v1p4beta1.ReferenceImage.fromObject(object.referenceImage); + } + if (object.referenceImageId != null) + message.referenceImageId = String(object.referenceImageId); + return message; + }; + + /** + * Creates a plain object from a CreateReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.CreateReferenceImageRequest} message CreateReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReferenceImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.referenceImage = null; + object.referenceImageId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.referenceImage != null && message.hasOwnProperty("referenceImage")) + object.referenceImage = $root.google.cloud.vision.v1p4beta1.ReferenceImage.toObject(message.referenceImage, options); + if (message.referenceImageId != null && message.hasOwnProperty("referenceImageId")) + object.referenceImageId = message.referenceImageId; + return object; + }; + + /** + * Converts this CreateReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.CreateReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateReferenceImageRequest; + })(); + + v1p4beta1.ListReferenceImagesRequest = (function() { + + /** + * Properties of a ListReferenceImagesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListReferenceImagesRequest + * @property {string|null} [parent] ListReferenceImagesRequest parent + * @property {number|null} [pageSize] ListReferenceImagesRequest pageSize + * @property {string|null} [pageToken] ListReferenceImagesRequest pageToken + */ + + /** + * Constructs a new ListReferenceImagesRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListReferenceImagesRequest. + * @implements IListReferenceImagesRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesRequest=} [properties] Properties to set + */ + function ListReferenceImagesRequest(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]]; + } + + /** + * ListReferenceImagesRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.parent = ""; + + /** + * ListReferenceImagesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.pageSize = 0; + + /** + * ListReferenceImagesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @instance + */ + ListReferenceImagesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListReferenceImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesRequest} ListReferenceImagesRequest instance + */ + ListReferenceImagesRequest.create = function create(properties) { + return new ListReferenceImagesRequest(properties); + }; + + /** + * Encodes the specified ListReferenceImagesRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesRequest} message ListReferenceImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListReferenceImagesRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesRequest} message ListReferenceImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesRequest} ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesRequest.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.vision.v1p4beta1.ListReferenceImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReferenceImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesRequest} ListReferenceImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReferenceImagesRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReferenceImagesRequest.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.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 ListReferenceImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesRequest} ListReferenceImagesRequest + */ + ListReferenceImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListReferenceImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ListReferenceImagesRequest} message ListReferenceImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReferenceImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListReferenceImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListReferenceImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReferenceImagesRequest; + })(); + + v1p4beta1.ListReferenceImagesResponse = (function() { + + /** + * Properties of a ListReferenceImagesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListReferenceImagesResponse + * @property {Array.|null} [referenceImages] ListReferenceImagesResponse referenceImages + * @property {number|null} [pageSize] ListReferenceImagesResponse pageSize + * @property {string|null} [nextPageToken] ListReferenceImagesResponse nextPageToken + */ + + /** + * Constructs a new ListReferenceImagesResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListReferenceImagesResponse. + * @implements IListReferenceImagesResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesResponse=} [properties] Properties to set + */ + function ListReferenceImagesResponse(properties) { + this.referenceImages = []; + 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]]; + } + + /** + * ListReferenceImagesResponse referenceImages. + * @member {Array.} referenceImages + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.referenceImages = $util.emptyArray; + + /** + * ListReferenceImagesResponse pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.pageSize = 0; + + /** + * ListReferenceImagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @instance + */ + ListReferenceImagesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReferenceImagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} ListReferenceImagesResponse instance + */ + ListReferenceImagesResponse.create = function create(properties) { + return new ListReferenceImagesResponse(properties); + }; + + /** + * Encodes the specified ListReferenceImagesResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesResponse} message ListReferenceImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceImages != null && message.referenceImages.length) + for (var i = 0; i < message.referenceImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.ReferenceImage.encode(message.referenceImages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListReferenceImagesResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListReferenceImagesResponse} message ListReferenceImagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferenceImagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesResponse.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.vision.v1p4beta1.ListReferenceImagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.referenceImages && message.referenceImages.length)) + message.referenceImages = []; + message.referenceImages.push($root.google.cloud.vision.v1p4beta1.ReferenceImage.decode(reader, reader.uint32())); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReferenceImagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} ListReferenceImagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferenceImagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReferenceImagesResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReferenceImagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceImages != null && message.hasOwnProperty("referenceImages")) { + if (!Array.isArray(message.referenceImages)) + return "referenceImages: array expected"; + for (var i = 0; i < message.referenceImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.ReferenceImage.verify(message.referenceImages[i]); + if (error) + return "referenceImages." + error; + } + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReferenceImagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} ListReferenceImagesResponse + */ + ListReferenceImagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse(); + if (object.referenceImages) { + if (!Array.isArray(object.referenceImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.referenceImages: array expected"); + message.referenceImages = []; + for (var i = 0; i < object.referenceImages.length; ++i) { + if (typeof object.referenceImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.referenceImages: object expected"); + message.referenceImages[i] = $root.google.cloud.vision.v1p4beta1.ReferenceImage.fromObject(object.referenceImages[i]); + } + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReferenceImagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @static + * @param {google.cloud.vision.v1p4beta1.ListReferenceImagesResponse} message ListReferenceImagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReferenceImagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.referenceImages = []; + if (options.defaults) { + object.pageSize = 0; + object.nextPageToken = ""; + } + if (message.referenceImages && message.referenceImages.length) { + object.referenceImages = []; + for (var j = 0; j < message.referenceImages.length; ++j) + object.referenceImages[j] = $root.google.cloud.vision.v1p4beta1.ReferenceImage.toObject(message.referenceImages[j], options); + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReferenceImagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListReferenceImagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListReferenceImagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReferenceImagesResponse; + })(); + + v1p4beta1.GetReferenceImageRequest = (function() { + + /** + * Properties of a GetReferenceImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IGetReferenceImageRequest + * @property {string|null} [name] GetReferenceImageRequest name + */ + + /** + * Constructs a new GetReferenceImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a GetReferenceImageRequest. + * @implements IGetReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IGetReferenceImageRequest=} [properties] Properties to set + */ + function GetReferenceImageRequest(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]]; + } + + /** + * GetReferenceImageRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @instance + */ + GetReferenceImageRequest.prototype.name = ""; + + /** + * Creates a new GetReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.GetReferenceImageRequest} GetReferenceImageRequest instance + */ + GetReferenceImageRequest.create = function create(properties) { + return new GetReferenceImageRequest(properties); + }; + + /** + * Encodes the specified GetReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetReferenceImageRequest} message GetReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReferenceImageRequest.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 GetReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.GetReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IGetReferenceImageRequest} message GetReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.GetReferenceImageRequest} GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReferenceImageRequest.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.vision.v1p4beta1.GetReferenceImageRequest(); + 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 GetReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.GetReferenceImageRequest} GetReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReferenceImageRequest.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 GetReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.GetReferenceImageRequest} GetReferenceImageRequest + */ + GetReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.GetReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.GetReferenceImageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.GetReferenceImageRequest} message GetReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReferenceImageRequest.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 GetReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.GetReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + GetReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetReferenceImageRequest; + })(); + + v1p4beta1.DeleteReferenceImageRequest = (function() { + + /** + * Properties of a DeleteReferenceImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IDeleteReferenceImageRequest + * @property {string|null} [name] DeleteReferenceImageRequest name + */ + + /** + * Constructs a new DeleteReferenceImageRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a DeleteReferenceImageRequest. + * @implements IDeleteReferenceImageRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest=} [properties] Properties to set + */ + function DeleteReferenceImageRequest(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]]; + } + + /** + * DeleteReferenceImageRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @instance + */ + DeleteReferenceImageRequest.prototype.name = ""; + + /** + * Creates a new DeleteReferenceImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest instance + */ + DeleteReferenceImageRequest.create = function create(properties) { + return new DeleteReferenceImageRequest(properties); + }; + + /** + * Encodes the specified DeleteReferenceImageRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest} message DeleteReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IDeleteReferenceImageRequest} message DeleteReferenceImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReferenceImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteReferenceImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReferenceImageRequest.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.vision.v1p4beta1.DeleteReferenceImageRequest(); + 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 DeleteReferenceImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReferenceImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteReferenceImageRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest} DeleteReferenceImageRequest + */ + DeleteReferenceImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteReferenceImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @static + * @param {google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest} message DeleteReferenceImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteReferenceImageRequest.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 DeleteReferenceImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReferenceImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteReferenceImageRequest; + })(); + + v1p4beta1.AddProductToProductSetRequest = (function() { + + /** + * Properties of an AddProductToProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IAddProductToProductSetRequest + * @property {string|null} [name] AddProductToProductSetRequest name + * @property {string|null} [product] AddProductToProductSetRequest product + */ + + /** + * Constructs a new AddProductToProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an AddProductToProductSetRequest. + * @implements IAddProductToProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest=} [properties] Properties to set + */ + function AddProductToProductSetRequest(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]]; + } + + /** + * AddProductToProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @instance + */ + AddProductToProductSetRequest.prototype.name = ""; + + /** + * AddProductToProductSetRequest product. + * @member {string} product + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @instance + */ + AddProductToProductSetRequest.prototype.product = ""; + + /** + * Creates a new AddProductToProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.AddProductToProductSetRequest} AddProductToProductSetRequest instance + */ + AddProductToProductSetRequest.create = function create(properties) { + return new AddProductToProductSetRequest(properties); + }; + + /** + * Encodes the specified AddProductToProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest} message AddProductToProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddProductToProductSetRequest.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.product != null && message.hasOwnProperty("product")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.product); + return writer; + }; + + /** + * Encodes the specified AddProductToProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IAddProductToProductSetRequest} message AddProductToProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddProductToProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.AddProductToProductSetRequest} AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddProductToProductSetRequest.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.vision.v1p4beta1.AddProductToProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.product = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddProductToProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.AddProductToProductSetRequest} AddProductToProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddProductToProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddProductToProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddProductToProductSetRequest.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.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + return null; + }; + + /** + * Creates an AddProductToProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.AddProductToProductSetRequest} AddProductToProductSetRequest + */ + AddProductToProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.product != null) + message.product = String(object.product); + return message; + }; + + /** + * Creates a plain object from an AddProductToProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.AddProductToProductSetRequest} message AddProductToProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddProductToProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.product = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + return object; + }; + + /** + * Converts this AddProductToProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.AddProductToProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + AddProductToProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddProductToProductSetRequest; + })(); + + v1p4beta1.RemoveProductFromProductSetRequest = (function() { + + /** + * Properties of a RemoveProductFromProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IRemoveProductFromProductSetRequest + * @property {string|null} [name] RemoveProductFromProductSetRequest name + * @property {string|null} [product] RemoveProductFromProductSetRequest product + */ + + /** + * Constructs a new RemoveProductFromProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a RemoveProductFromProductSetRequest. + * @implements IRemoveProductFromProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest=} [properties] Properties to set + */ + function RemoveProductFromProductSetRequest(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]]; + } + + /** + * RemoveProductFromProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @instance + */ + RemoveProductFromProductSetRequest.prototype.name = ""; + + /** + * RemoveProductFromProductSetRequest product. + * @member {string} product + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @instance + */ + RemoveProductFromProductSetRequest.prototype.product = ""; + + /** + * Creates a new RemoveProductFromProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest instance + */ + RemoveProductFromProductSetRequest.create = function create(properties) { + return new RemoveProductFromProductSetRequest(properties); + }; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveProductFromProductSetRequest.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.product != null && message.hasOwnProperty("product")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.product); + return writer; + }; + + /** + * Encodes the specified RemoveProductFromProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IRemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveProductFromProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveProductFromProductSetRequest.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.vision.v1p4beta1.RemoveProductFromProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.product = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveProductFromProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveProductFromProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveProductFromProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveProductFromProductSetRequest.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.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + return null; + }; + + /** + * Creates a RemoveProductFromProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest} RemoveProductFromProductSetRequest + */ + RemoveProductFromProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.product != null) + message.product = String(object.product); + return message; + }; + + /** + * Creates a plain object from a RemoveProductFromProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest} message RemoveProductFromProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveProductFromProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.product = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + return object; + }; + + /** + * Converts this RemoveProductFromProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveProductFromProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveProductFromProductSetRequest; + })(); + + v1p4beta1.ListProductsInProductSetRequest = (function() { + + /** + * Properties of a ListProductsInProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListProductsInProductSetRequest + * @property {string|null} [name] ListProductsInProductSetRequest name + * @property {number|null} [pageSize] ListProductsInProductSetRequest pageSize + * @property {string|null} [pageToken] ListProductsInProductSetRequest pageToken + */ + + /** + * Constructs a new ListProductsInProductSetRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListProductsInProductSetRequest. + * @implements IListProductsInProductSetRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest=} [properties] Properties to set + */ + function ListProductsInProductSetRequest(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]]; + } + + /** + * ListProductsInProductSetRequest name. + * @member {string} name + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.name = ""; + + /** + * ListProductsInProductSetRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.pageSize = 0; + + /** + * ListProductsInProductSetRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @instance + */ + ListProductsInProductSetRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProductsInProductSetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest instance + */ + ListProductsInProductSetRequest.create = function create(properties) { + return new ListProductsInProductSetRequest(properties); + }; + + /** + * Encodes the specified ListProductsInProductSetRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest} message ListProductsInProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProductsInProductSetRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetRequest} message ListProductsInProductSetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetRequest.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.vision.v1p4beta1.ListProductsInProductSetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsInProductSetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsInProductSetRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsInProductSetRequest.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.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 ListProductsInProductSetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest} ListProductsInProductSetRequest + */ + ListProductsInProductSetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListProductsInProductSetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest} message ListProductsInProductSetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsInProductSetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 ListProductsInProductSetRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductsInProductSetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsInProductSetRequest; + })(); + + v1p4beta1.ListProductsInProductSetResponse = (function() { + + /** + * Properties of a ListProductsInProductSetResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IListProductsInProductSetResponse + * @property {Array.|null} [products] ListProductsInProductSetResponse products + * @property {string|null} [nextPageToken] ListProductsInProductSetResponse nextPageToken + */ + + /** + * Constructs a new ListProductsInProductSetResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a ListProductsInProductSetResponse. + * @implements IListProductsInProductSetResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse=} [properties] Properties to set + */ + function ListProductsInProductSetResponse(properties) { + this.products = []; + 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]]; + } + + /** + * ListProductsInProductSetResponse products. + * @member {Array.} products + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @instance + */ + ListProductsInProductSetResponse.prototype.products = $util.emptyArray; + + /** + * ListProductsInProductSetResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @instance + */ + ListProductsInProductSetResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductsInProductSetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse instance + */ + ListProductsInProductSetResponse.create = function create(properties) { + return new ListProductsInProductSetResponse(properties); + }; + + /** + * Encodes the specified ListProductsInProductSetResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse} message ListProductsInProductSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.vision.v1p4beta1.Product.encode(message.products[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 ListProductsInProductSetResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IListProductsInProductSetResponse} message ListProductsInProductSetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsInProductSetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetResponse.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.vision.v1p4beta1.ListProductsInProductSetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.vision.v1p4beta1.Product.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsInProductSetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsInProductSetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsInProductSetResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsInProductSetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductsInProductSetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} ListProductsInProductSetResponse + */ + ListProductsInProductSetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.products: object expected"); + message.products[i] = $root.google.cloud.vision.v1p4beta1.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsInProductSetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @static + * @param {google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse} message ListProductsInProductSetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsInProductSetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.vision.v1p4beta1.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductsInProductSetResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductsInProductSetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListProductsInProductSetResponse; + })(); + + v1p4beta1.ImportProductSetsGcsSource = (function() { + + /** + * Properties of an ImportProductSetsGcsSource. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImportProductSetsGcsSource + * @property {string|null} [csvFileUri] ImportProductSetsGcsSource csvFileUri + */ + + /** + * Constructs a new ImportProductSetsGcsSource. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImportProductSetsGcsSource. + * @implements IImportProductSetsGcsSource + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource=} [properties] Properties to set + */ + function ImportProductSetsGcsSource(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]]; + } + + /** + * ImportProductSetsGcsSource csvFileUri. + * @member {string} csvFileUri + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @instance + */ + ImportProductSetsGcsSource.prototype.csvFileUri = ""; + + /** + * Creates a new ImportProductSetsGcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource instance + */ + ImportProductSetsGcsSource.create = function create(properties) { + return new ImportProductSetsGcsSource(properties); + }; + + /** + * Encodes the specified ImportProductSetsGcsSource message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource} message ImportProductSetsGcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsGcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.csvFileUri); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsGcsSource message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource} message ImportProductSetsGcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsGcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsGcsSource.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.vision.v1p4beta1.ImportProductSetsGcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.csvFileUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsGcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsGcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsGcsSource message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsGcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + if (!$util.isString(message.csvFileUri)) + return "csvFileUri: string expected"; + return null; + }; + + /** + * Creates an ImportProductSetsGcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource} ImportProductSetsGcsSource + */ + ImportProductSetsGcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource(); + if (object.csvFileUri != null) + message.csvFileUri = String(object.csvFileUri); + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsGcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @static + * @param {google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource} message ImportProductSetsGcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsGcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.csvFileUri = ""; + if (message.csvFileUri != null && message.hasOwnProperty("csvFileUri")) + object.csvFileUri = message.csvFileUri; + return object; + }; + + /** + * Converts this ImportProductSetsGcsSource to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsGcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsGcsSource; + })(); + + v1p4beta1.ImportProductSetsInputConfig = (function() { + + /** + * Properties of an ImportProductSetsInputConfig. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImportProductSetsInputConfig + * @property {google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource|null} [gcsSource] ImportProductSetsInputConfig gcsSource + */ + + /** + * Constructs a new ImportProductSetsInputConfig. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImportProductSetsInputConfig. + * @implements IImportProductSetsInputConfig + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig=} [properties] Properties to set + */ + function ImportProductSetsInputConfig(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]]; + } + + /** + * ImportProductSetsInputConfig gcsSource. + * @member {google.cloud.vision.v1p4beta1.IImportProductSetsGcsSource|null|undefined} gcsSource + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @instance + */ + ImportProductSetsInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportProductSetsInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @instance + */ + Object.defineProperty(ImportProductSetsInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportProductSetsInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig instance + */ + ImportProductSetsInputConfig.create = function create(properties) { + return new ImportProductSetsInputConfig(properties); + }; + + /** + * Encodes the specified ImportProductSetsInputConfig message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig} message ImportProductSetsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsInputConfig message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig} message ImportProductSetsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsInputConfig.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.vision.v1p4beta1.ImportProductSetsInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsInputConfig message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsInputConfig.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.vision.v1p4beta1.ImportProductSetsGcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates an ImportProductSetsInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig} ImportProductSetsInputConfig + */ + ImportProductSetsInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @static + * @param {google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig} message ImportProductSetsInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this ImportProductSetsInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsInputConfig; + })(); + + v1p4beta1.ImportProductSetsRequest = (function() { + + /** + * Properties of an ImportProductSetsRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImportProductSetsRequest + * @property {string|null} [parent] ImportProductSetsRequest parent + * @property {google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig|null} [inputConfig] ImportProductSetsRequest inputConfig + */ + + /** + * Constructs a new ImportProductSetsRequest. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImportProductSetsRequest. + * @implements IImportProductSetsRequest + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsRequest=} [properties] Properties to set + */ + function ImportProductSetsRequest(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]]; + } + + /** + * ImportProductSetsRequest parent. + * @member {string} parent + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @instance + */ + ImportProductSetsRequest.prototype.parent = ""; + + /** + * ImportProductSetsRequest inputConfig. + * @member {google.cloud.vision.v1p4beta1.IImportProductSetsInputConfig|null|undefined} inputConfig + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @instance + */ + ImportProductSetsRequest.prototype.inputConfig = null; + + /** + * Creates a new ImportProductSetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsRequest=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsRequest} ImportProductSetsRequest instance + */ + ImportProductSetsRequest.create = function create(properties) { + return new ImportProductSetsRequest(properties); + }; + + /** + * Encodes the specified ImportProductSetsRequest message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsRequest} message ImportProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsRequest message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsRequest} message ImportProductSetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsRequest} ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsRequest.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.vision.v1p4beta1.ImportProductSetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.inputConfig = $root.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsRequest} ImportProductSetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsRequest message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + return null; + }; + + /** + * Creates an ImportProductSetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsRequest} ImportProductSetsRequest + */ + ImportProductSetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImportProductSetsRequest) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImportProductSetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImportProductSetsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.fromObject(object.inputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @static + * @param {google.cloud.vision.v1p4beta1.ImportProductSetsRequest} message ImportProductSetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.toObject(message.inputConfig, options); + return object; + }; + + /** + * Converts this ImportProductSetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsRequest; + })(); + + v1p4beta1.ImportProductSetsResponse = (function() { + + /** + * Properties of an ImportProductSetsResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IImportProductSetsResponse + * @property {Array.|null} [referenceImages] ImportProductSetsResponse referenceImages + * @property {Array.|null} [statuses] ImportProductSetsResponse statuses + */ + + /** + * Constructs a new ImportProductSetsResponse. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents an ImportProductSetsResponse. + * @implements IImportProductSetsResponse + * @constructor + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsResponse=} [properties] Properties to set + */ + function ImportProductSetsResponse(properties) { + this.referenceImages = []; + this.statuses = []; + 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]]; + } + + /** + * ImportProductSetsResponse referenceImages. + * @member {Array.} referenceImages + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @instance + */ + ImportProductSetsResponse.prototype.referenceImages = $util.emptyArray; + + /** + * ImportProductSetsResponse statuses. + * @member {Array.} statuses + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @instance + */ + ImportProductSetsResponse.prototype.statuses = $util.emptyArray; + + /** + * Creates a new ImportProductSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsResponse=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsResponse} ImportProductSetsResponse instance + */ + ImportProductSetsResponse.create = function create(properties) { + return new ImportProductSetsResponse(properties); + }; + + /** + * Encodes the specified ImportProductSetsResponse message. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsResponse} message ImportProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceImages != null && message.referenceImages.length) + for (var i = 0; i < message.referenceImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.ReferenceImage.encode(message.referenceImages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.statuses != null && message.statuses.length) + for (var i = 0; i < message.statuses.length; ++i) + $root.google.rpc.Status.encode(message.statuses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProductSetsResponse message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.ImportProductSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.IImportProductSetsResponse} message ImportProductSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProductSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsResponse} ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsResponse.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.vision.v1p4beta1.ImportProductSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.referenceImages && message.referenceImages.length)) + message.referenceImages = []; + message.referenceImages.push($root.google.cloud.vision.v1p4beta1.ReferenceImage.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.statuses && message.statuses.length)) + message.statuses = []; + message.statuses.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProductSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsResponse} ImportProductSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProductSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProductSetsResponse message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProductSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceImages != null && message.hasOwnProperty("referenceImages")) { + if (!Array.isArray(message.referenceImages)) + return "referenceImages: array expected"; + for (var i = 0; i < message.referenceImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.ReferenceImage.verify(message.referenceImages[i]); + if (error) + return "referenceImages." + error; + } + } + if (message.statuses != null && message.hasOwnProperty("statuses")) { + if (!Array.isArray(message.statuses)) + return "statuses: array expected"; + for (var i = 0; i < message.statuses.length; ++i) { + var error = $root.google.rpc.Status.verify(message.statuses[i]); + if (error) + return "statuses." + error; + } + } + return null; + }; + + /** + * Creates an ImportProductSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.ImportProductSetsResponse} ImportProductSetsResponse + */ + ImportProductSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.ImportProductSetsResponse) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.ImportProductSetsResponse(); + if (object.referenceImages) { + if (!Array.isArray(object.referenceImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.ImportProductSetsResponse.referenceImages: array expected"); + message.referenceImages = []; + for (var i = 0; i < object.referenceImages.length; ++i) { + if (typeof object.referenceImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImportProductSetsResponse.referenceImages: object expected"); + message.referenceImages[i] = $root.google.cloud.vision.v1p4beta1.ReferenceImage.fromObject(object.referenceImages[i]); + } + } + if (object.statuses) { + if (!Array.isArray(object.statuses)) + throw TypeError(".google.cloud.vision.v1p4beta1.ImportProductSetsResponse.statuses: array expected"); + message.statuses = []; + for (var i = 0; i < object.statuses.length; ++i) { + if (typeof object.statuses[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.ImportProductSetsResponse.statuses: object expected"); + message.statuses[i] = $root.google.rpc.Status.fromObject(object.statuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportProductSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @static + * @param {google.cloud.vision.v1p4beta1.ImportProductSetsResponse} message ImportProductSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProductSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.referenceImages = []; + object.statuses = []; + } + if (message.referenceImages && message.referenceImages.length) { + object.referenceImages = []; + for (var j = 0; j < message.referenceImages.length; ++j) + object.referenceImages[j] = $root.google.cloud.vision.v1p4beta1.ReferenceImage.toObject(message.referenceImages[j], options); + } + if (message.statuses && message.statuses.length) { + object.statuses = []; + for (var j = 0; j < message.statuses.length; ++j) + object.statuses[j] = $root.google.rpc.Status.toObject(message.statuses[j], options); + } + return object; + }; + + /** + * Converts this ImportProductSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.ImportProductSetsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportProductSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportProductSetsResponse; + })(); + + v1p4beta1.BatchOperationMetadata = (function() { + + /** + * Properties of a BatchOperationMetadata. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IBatchOperationMetadata + * @property {google.cloud.vision.v1p4beta1.BatchOperationMetadata.State|null} [state] BatchOperationMetadata state + * @property {google.protobuf.ITimestamp|null} [submitTime] BatchOperationMetadata submitTime + * @property {google.protobuf.ITimestamp|null} [endTime] BatchOperationMetadata endTime + */ + + /** + * Constructs a new BatchOperationMetadata. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a BatchOperationMetadata. + * @implements IBatchOperationMetadata + * @constructor + * @param {google.cloud.vision.v1p4beta1.IBatchOperationMetadata=} [properties] Properties to set + */ + function BatchOperationMetadata(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]]; + } + + /** + * BatchOperationMetadata state. + * @member {google.cloud.vision.v1p4beta1.BatchOperationMetadata.State} state + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.state = 0; + + /** + * BatchOperationMetadata submitTime. + * @member {google.protobuf.ITimestamp|null|undefined} submitTime + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.submitTime = null; + + /** + * BatchOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.endTime = null; + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.BatchOperationMetadata} BatchOperationMetadata instance + */ + BatchOperationMetadata.create = function create(properties) { + return new BatchOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && message.hasOwnProperty("state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + $root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.BatchOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.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.vision.v1p4beta1.BatchOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + case 2: + message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOperationMetadata message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.submitTime != null && message.hasOwnProperty("submitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTime); + if (error) + return "submitTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.BatchOperationMetadata} BatchOperationMetadata + */ + BatchOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.BatchOperationMetadata) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.BatchOperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PROCESSING": + case 1: + message.state = 1; + break; + case "SUCCESSFUL": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + if (object.submitTime != null) { + if (typeof object.submitTime !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.BatchOperationMetadata.submitTime: object expected"); + message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.BatchOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @static + * @param {google.cloud.vision.v1p4beta1.BatchOperationMetadata} message BatchOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.submitTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State[message.state] : message.state; + if (message.submitTime != null && message.hasOwnProperty("submitTime")) + object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.BatchOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.vision.v1p4beta1.BatchOperationMetadata.State + * @enum {string} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROCESSING=1 PROCESSING value + * @property {number} SUCCESSFUL=2 SUCCESSFUL value + * @property {number} FAILED=3 FAILED value + * @property {number} CANCELLED=4 CANCELLED value + */ + BatchOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROCESSING"] = 1; + values[valuesById[2] = "SUCCESSFUL"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return BatchOperationMetadata; + })(); + + v1p4beta1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ITextAnnotation + * @property {Array.|null} [pages] TextAnnotation pages + * @property {string|null} [text] TextAnnotation text + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.vision.v1p4beta1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.pages = []; + 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]]; + } + + /** + * TextAnnotation pages. + * @member {Array.} pages + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.pages = $util.emptyArray; + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) + for (var i = 0; i < message.pages.length; ++i) + $root.google.cloud.vision.v1p4beta1.Page.encode(message.pages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.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.vision.v1p4beta1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.vision.v1p4beta1.Page.decode(reader, reader.uint32())); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Page.verify(message.pages[i]); + if (error) + return "pages." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.TextAnnotation) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.TextAnnotation(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.vision.v1p4beta1.TextAnnotation.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) { + if (typeof object.pages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.TextAnnotation.pages: object expected"); + message.pages[i] = $root.google.cloud.vision.v1p4beta1.Page.fromObject(object.pages[i]); + } + } + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (options.defaults) + object.text = ""; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = $root.google.cloud.vision.v1p4beta1.Page.toObject(message.pages[j], options); + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TextAnnotation.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + */ + function DetectedLanguage(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]]; + } + + /** + * DetectedLanguage languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage} DetectedLanguage instance + */ + DetectedLanguage.create = function create(properties) { + return new DetectedLanguage(properties); + }; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedLanguage} message DetectedLanguage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLanguage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.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.vision.v1p4beta1.TextAnnotation.DetectedLanguage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLanguage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLanguage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLanguage message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLanguage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLanguage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLanguage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage} message DetectedLanguage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLanguage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.languageCode = ""; + object.confidence = 0; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLanguage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage + * @instance + * @returns {Object.} JSON object + */ + DetectedLanguage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectedLanguage; + })(); + + TextAnnotation.DetectedBreak = (function() { + + /** + * Properties of a DetectedBreak. + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @interface IDetectedBreak + * @property {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType|null} [type] DetectedBreak type + * @property {boolean|null} [isPrefix] DetectedBreak isPrefix + */ + + /** + * Constructs a new DetectedBreak. + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @classdesc Represents a DetectedBreak. + * @implements IDetectedBreak + * @constructor + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + */ + function DetectedBreak(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]]; + } + + /** + * DetectedBreak type. + * @member {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType} type + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.type = 0; + + /** + * DetectedBreak isPrefix. + * @member {boolean} isPrefix + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @instance + */ + DetectedBreak.prototype.isPrefix = false; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak} DetectedBreak instance + */ + DetectedBreak.create = function create(properties) { + return new DetectedBreak(properties); + }; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isPrefix); + return writer; + }; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak} message DetectedBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedBreak.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.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.vision.v1p4beta1.TextAnnotation.DetectedBreak(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + case 2: + message.isPrefix = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedBreak message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak} DetectedBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedBreak.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedBreak message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedBreak.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + if (typeof message.isPrefix !== "boolean") + return "isPrefix: boolean expected"; + return null; + }; + + /** + * Creates a DetectedBreak message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak} DetectedBreak + */ + DetectedBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak(); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "SPACE": + case 1: + message.type = 1; + break; + case "SURE_SPACE": + case 2: + message.type = 2; + break; + case "EOL_SURE_SPACE": + case 3: + message.type = 3; + break; + case "HYPHEN": + case 4: + message.type = 4; + break; + case "LINE_BREAK": + case 5: + message.type = 5; + break; + } + if (object.isPrefix != null) + message.isPrefix = Boolean(object.isPrefix); + return message; + }; + + /** + * Creates a plain object from a DetectedBreak message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak} message DetectedBreak + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedBreak.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "UNKNOWN" : 0; + object.isPrefix = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType[message.type] : message.type; + if (message.isPrefix != null && message.hasOwnProperty("isPrefix")) + object.isPrefix = message.isPrefix; + return object; + }; + + /** + * Converts this DetectedBreak to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak + * @instance + * @returns {Object.} JSON object + */ + DetectedBreak.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BreakType enum. + * @name google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SPACE=1 SPACE value + * @property {number} SURE_SPACE=2 SURE_SPACE value + * @property {number} EOL_SURE_SPACE=3 EOL_SURE_SPACE value + * @property {number} HYPHEN=4 HYPHEN value + * @property {number} LINE_BREAK=5 LINE_BREAK value + */ + DetectedBreak.BreakType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SPACE"] = 1; + values[valuesById[2] = "SURE_SPACE"] = 2; + values[valuesById[3] = "EOL_SURE_SPACE"] = 3; + values[valuesById[4] = "HYPHEN"] = 4; + values[valuesById[5] = "LINE_BREAK"] = 5; + return values; + })(); + + return DetectedBreak; + })(); + + TextAnnotation.TextProperty = (function() { + + /** + * Properties of a TextProperty. + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @interface ITextProperty + * @property {Array.|null} [detectedLanguages] TextProperty detectedLanguages + * @property {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak|null} [detectedBreak] TextProperty detectedBreak + */ + + /** + * Constructs a new TextProperty. + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation + * @classdesc Represents a TextProperty. + * @implements ITextProperty + * @constructor + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + */ + function TextProperty(properties) { + this.detectedLanguages = []; + 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]]; + } + + /** + * TextProperty detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedLanguages = $util.emptyArray; + + /** + * TextProperty detectedBreak. + * @member {google.cloud.vision.v1p4beta1.TextAnnotation.IDetectedBreak|null|undefined} detectedBreak + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @instance + */ + TextProperty.prototype.detectedBreak = null; + + /** + * Creates a new TextProperty instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty} TextProperty instance + */ + TextProperty.create = function create(properties) { + return new TextProperty(properties); + }; + + /** + * Encodes the specified TextProperty message. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectedLanguages != null && message.detectedLanguages.length) + for (var i = 0; i < message.detectedLanguages.length; ++i) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.encode(message.detectedBreak, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextProperty message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty} message TextProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.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.vision.v1p4beta1.TextAnnotation.TextProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.detectedLanguages && message.detectedLanguages.length)) + message.detectedLanguages = []; + message.detectedLanguages.push($root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.decode(reader, reader.uint32())); + break; + case 2: + message.detectedBreak = $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty} TextProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextProperty message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detectedLanguages != null && message.hasOwnProperty("detectedLanguages")) { + if (!Array.isArray(message.detectedLanguages)) + return "detectedLanguages: array expected"; + for (var i = 0; i < message.detectedLanguages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.verify(message.detectedLanguages[i]); + if (error) + return "detectedLanguages." + error; + } + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.verify(message.detectedBreak); + if (error) + return "detectedBreak." + error; + } + return null; + }; + + /** + * Creates a TextProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty} TextProperty + */ + TextProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty(); + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.detectedLanguages: array expected"); + message.detectedLanguages = []; + for (var i = 0; i < object.detectedLanguages.length; ++i) { + if (typeof object.detectedLanguages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.detectedBreak != null) { + if (typeof object.detectedBreak !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.detectedBreak: object expected"); + message.detectedBreak = $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.fromObject(object.detectedBreak); + } + return message; + }; + + /** + * Creates a plain object from a TextProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @static + * @param {google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty} message TextProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedLanguages = []; + if (options.defaults) + object.detectedBreak = null; + if (message.detectedLanguages && message.detectedLanguages.length) { + object.detectedLanguages = []; + for (var j = 0; j < message.detectedLanguages.length; ++j) + object.detectedLanguages[j] = $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + object.detectedBreak = $root.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.toObject(message.detectedBreak, options); + return object; + }; + + /** + * Converts this TextProperty to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty + * @instance + * @returns {Object.} JSON object + */ + TextProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextProperty; + })(); + + return TextAnnotation; + })(); + + v1p4beta1.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IPage + * @property {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null} [property] Page property + * @property {number|null} [width] Page width + * @property {number|null} [height] Page height + * @property {Array.|null} [blocks] Page blocks + * @property {number|null} [confidence] Page confidence + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.vision.v1p4beta1.IPage=} [properties] Properties to set + */ + function Page(properties) { + this.blocks = []; + 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]]; + } + + /** + * Page property. + * @member {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p4beta1.Page + * @instance + */ + Page.prototype.property = null; + + /** + * Page width. + * @member {number} width + * @memberof google.cloud.vision.v1p4beta1.Page + * @instance + */ + Page.prototype.width = 0; + + /** + * Page height. + * @member {number} height + * @memberof google.cloud.vision.v1p4beta1.Page + * @instance + */ + Page.prototype.height = 0; + + /** + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.vision.v1p4beta1.Page + * @instance + */ + Page.prototype.blocks = $util.emptyArray; + + /** + * Page confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.Page + * @instance + */ + Page.prototype.confidence = 0; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {google.cloud.vision.v1p4beta1.IPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Page} Page instance + */ + Page.create = function create(properties) { + return new Page(properties); + }; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {google.cloud.vision.v1p4beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.width != null && message.hasOwnProperty("width")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.width); + if (message.height != null && message.hasOwnProperty("height")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.height); + if (message.blocks != null && message.blocks.length) + for (var i = 0; i < message.blocks.length; ++i) + $root.google.cloud.vision.v1p4beta1.Block.encode(message.blocks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {google.cloud.vision.v1p4beta1.IPage} message Page message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Page.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Page message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.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.vision.v1p4beta1.Page(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.width = reader.int32(); + break; + case 3: + message.height = reader.int32(); + break; + case 4: + if (!(message.blocks && message.blocks.length)) + message.blocks = []; + message.blocks.push($root.google.cloud.vision.v1p4beta1.Block.decode(reader, reader.uint32())); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Page message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Page} Page + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Page.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Page message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Page.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.blocks != null && message.hasOwnProperty("blocks")) { + if (!Array.isArray(message.blocks)) + return "blocks: array expected"; + for (var i = 0; i < message.blocks.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Block.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Page message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Page) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Page(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Page.property: object expected"); + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.vision.v1p4beta1.Page.blocks: array expected"); + message.blocks = []; + for (var i = 0; i < object.blocks.length; ++i) { + if (typeof object.blocks[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Page.blocks: object expected"); + message.blocks[i] = $root.google.cloud.vision.v1p4beta1.Block.fromObject(object.blocks[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Page message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Page + * @static + * @param {google.cloud.vision.v1p4beta1.Page} message Page + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Page.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blocks = []; + if (options.defaults) { + object.property = null; + object.width = 0; + object.height = 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.blocks && message.blocks.length) { + object.blocks = []; + for (var j = 0; j < message.blocks.length; ++j) + object.blocks[j] = $root.google.cloud.vision.v1p4beta1.Block.toObject(message.blocks[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Page + * @instance + * @returns {Object.} JSON object + */ + Page.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Page; + })(); + + v1p4beta1.Block = (function() { + + /** + * Properties of a Block. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IBlock + * @property {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null} [property] Block property + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingBox] Block boundingBox + * @property {Array.|null} [paragraphs] Block paragraphs + * @property {google.cloud.vision.v1p4beta1.Block.BlockType|null} [blockType] Block blockType + * @property {number|null} [confidence] Block confidence + */ + + /** + * Constructs a new Block. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {google.cloud.vision.v1p4beta1.IBlock=} [properties] Properties to set + */ + function Block(properties) { + this.paragraphs = []; + 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]]; + } + + /** + * Block property. + * @member {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p4beta1.Block + * @instance + */ + Block.prototype.property = null; + + /** + * Block boundingBox. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p4beta1.Block + * @instance + */ + Block.prototype.boundingBox = null; + + /** + * Block paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.vision.v1p4beta1.Block + * @instance + */ + Block.prototype.paragraphs = $util.emptyArray; + + /** + * Block blockType. + * @member {google.cloud.vision.v1p4beta1.Block.BlockType} blockType + * @memberof google.cloud.vision.v1p4beta1.Block + * @instance + */ + Block.prototype.blockType = 0; + + /** + * Block confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.Block + * @instance + */ + Block.prototype.confidence = 0; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {google.cloud.vision.v1p4beta1.IBlock=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Block} Block instance + */ + Block.create = function create(properties) { + return new Block(properties); + }; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Block.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {google.cloud.vision.v1p4beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paragraphs != null && message.paragraphs.length) + for (var i = 0; i < message.paragraphs.length; ++i) + $root.google.cloud.vision.v1p4beta1.Paragraph.encode(message.paragraphs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.blockType != null && message.hasOwnProperty("blockType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.blockType); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {google.cloud.vision.v1p4beta1.IBlock} message Block message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Block.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Block message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.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.vision.v1p4beta1.Block(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.paragraphs && message.paragraphs.length)) + message.paragraphs = []; + message.paragraphs.push($root.google.cloud.vision.v1p4beta1.Paragraph.decode(reader, reader.uint32())); + break; + case 4: + message.blockType = reader.int32(); + break; + case 5: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Block message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Block} Block + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Block.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Block message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Block.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.paragraphs != null && message.hasOwnProperty("paragraphs")) { + if (!Array.isArray(message.paragraphs)) + return "paragraphs: array expected"; + for (var i = 0; i < message.paragraphs.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Paragraph.verify(message.paragraphs[i]); + if (error) + return "paragraphs." + error; + } + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + switch (message.blockType) { + default: + return "blockType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Block message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Block) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Block(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Block.property: object expected"); + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Block.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.paragraphs) { + if (!Array.isArray(object.paragraphs)) + throw TypeError(".google.cloud.vision.v1p4beta1.Block.paragraphs: array expected"); + message.paragraphs = []; + for (var i = 0; i < object.paragraphs.length; ++i) { + if (typeof object.paragraphs[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Block.paragraphs: object expected"); + message.paragraphs[i] = $root.google.cloud.vision.v1p4beta1.Paragraph.fromObject(object.paragraphs[i]); + } + } + switch (object.blockType) { + case "UNKNOWN": + case 0: + message.blockType = 0; + break; + case "TEXT": + case 1: + message.blockType = 1; + break; + case "TABLE": + case 2: + message.blockType = 2; + break; + case "PICTURE": + case 3: + message.blockType = 3; + break; + case "RULER": + case 4: + message.blockType = 4; + break; + case "BARCODE": + case 5: + message.blockType = 5; + break; + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Block message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Block + * @static + * @param {google.cloud.vision.v1p4beta1.Block} message Block + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Block.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paragraphs = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.blockType = options.enums === String ? "UNKNOWN" : 0; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.paragraphs && message.paragraphs.length) { + object.paragraphs = []; + for (var j = 0; j < message.paragraphs.length; ++j) + object.paragraphs[j] = $root.google.cloud.vision.v1p4beta1.Paragraph.toObject(message.paragraphs[j], options); + } + if (message.blockType != null && message.hasOwnProperty("blockType")) + object.blockType = options.enums === String ? $root.google.cloud.vision.v1p4beta1.Block.BlockType[message.blockType] : message.blockType; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Block + * @instance + * @returns {Object.} JSON object + */ + Block.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BlockType enum. + * @name google.cloud.vision.v1p4beta1.Block.BlockType + * @enum {string} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} TEXT=1 TEXT value + * @property {number} TABLE=2 TABLE value + * @property {number} PICTURE=3 PICTURE value + * @property {number} RULER=4 RULER value + * @property {number} BARCODE=5 BARCODE value + */ + Block.BlockType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "TABLE"] = 2; + values[valuesById[3] = "PICTURE"] = 3; + values[valuesById[4] = "RULER"] = 4; + values[valuesById[5] = "BARCODE"] = 5; + return values; + })(); + + return Block; + })(); + + v1p4beta1.Paragraph = (function() { + + /** + * Properties of a Paragraph. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IParagraph + * @property {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null} [property] Paragraph property + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingBox] Paragraph boundingBox + * @property {Array.|null} [words] Paragraph words + * @property {number|null} [confidence] Paragraph confidence + */ + + /** + * Constructs a new Paragraph. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Paragraph. + * @implements IParagraph + * @constructor + * @param {google.cloud.vision.v1p4beta1.IParagraph=} [properties] Properties to set + */ + function Paragraph(properties) { + this.words = []; + 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]]; + } + + /** + * Paragraph property. + * @member {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @instance + */ + Paragraph.prototype.property = null; + + /** + * Paragraph boundingBox. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @instance + */ + Paragraph.prototype.boundingBox = null; + + /** + * Paragraph words. + * @member {Array.} words + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @instance + */ + Paragraph.prototype.words = $util.emptyArray; + + /** + * Paragraph confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @instance + */ + Paragraph.prototype.confidence = 0; + + /** + * Creates a new Paragraph instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p4beta1.IParagraph=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Paragraph} Paragraph instance + */ + Paragraph.create = function create(properties) { + return new Paragraph(properties); + }; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Paragraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p4beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.vision.v1p4beta1.Word.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Paragraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p4beta1.IParagraph} message Paragraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Paragraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.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.vision.v1p4beta1.Paragraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.vision.v1p4beta1.Word.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Paragraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Paragraph} Paragraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Paragraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Paragraph message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Paragraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Word.verify(message.words[i]); + if (error) + return "words." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Paragraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Paragraph} Paragraph + */ + Paragraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Paragraph) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Paragraph(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Paragraph.property: object expected"); + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Paragraph.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.vision.v1p4beta1.Paragraph.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Paragraph.words: object expected"); + message.words[i] = $root.google.cloud.vision.v1p4beta1.Word.fromObject(object.words[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Paragraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @static + * @param {google.cloud.vision.v1p4beta1.Paragraph} message Paragraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Paragraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.vision.v1p4beta1.Word.toObject(message.words[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Paragraph to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Paragraph + * @instance + * @returns {Object.} JSON object + */ + Paragraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Paragraph; + })(); + + v1p4beta1.Word = (function() { + + /** + * Properties of a Word. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IWord + * @property {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null} [property] Word property + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingBox] Word boundingBox + * @property {Array.|null} [symbols] Word symbols + * @property {number|null} [confidence] Word confidence + */ + + /** + * Constructs a new Word. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Word. + * @implements IWord + * @constructor + * @param {google.cloud.vision.v1p4beta1.IWord=} [properties] Properties to set + */ + function Word(properties) { + this.symbols = []; + 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]]; + } + + /** + * Word property. + * @member {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p4beta1.Word + * @instance + */ + Word.prototype.property = null; + + /** + * Word boundingBox. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p4beta1.Word + * @instance + */ + Word.prototype.boundingBox = null; + + /** + * Word symbols. + * @member {Array.} symbols + * @memberof google.cloud.vision.v1p4beta1.Word + * @instance + */ + Word.prototype.symbols = $util.emptyArray; + + /** + * Word confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.Word + * @instance + */ + Word.prototype.confidence = 0; + + /** + * Creates a new Word instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {google.cloud.vision.v1p4beta1.IWord=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Word} Word instance + */ + Word.create = function create(properties) { + return new Word(properties); + }; + + /** + * Encodes the specified Word message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Word.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {google.cloud.vision.v1p4beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.symbols != null && message.symbols.length) + for (var i = 0; i < message.symbols.length; ++i) + $root.google.cloud.vision.v1p4beta1.Symbol.encode(message.symbols[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Word message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Word.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {google.cloud.vision.v1p4beta1.IWord} message Word message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Word.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Word message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.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.vision.v1p4beta1.Word(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.symbols && message.symbols.length)) + message.symbols = []; + message.symbols.push($root.google.cloud.vision.v1p4beta1.Symbol.decode(reader, reader.uint32())); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Word message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Word} Word + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Word.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Word message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Word.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.symbols != null && message.hasOwnProperty("symbols")) { + if (!Array.isArray(message.symbols)) + return "symbols: array expected"; + for (var i = 0; i < message.symbols.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.Symbol.verify(message.symbols[i]); + if (error) + return "symbols." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Word message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Word} Word + */ + Word.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Word) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Word(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Word.property: object expected"); + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Word.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.symbols) { + if (!Array.isArray(object.symbols)) + throw TypeError(".google.cloud.vision.v1p4beta1.Word.symbols: array expected"); + message.symbols = []; + for (var i = 0; i < object.symbols.length; ++i) { + if (typeof object.symbols[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Word.symbols: object expected"); + message.symbols[i] = $root.google.cloud.vision.v1p4beta1.Symbol.fromObject(object.symbols[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Word message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Word + * @static + * @param {google.cloud.vision.v1p4beta1.Word} message Word + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Word.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.symbols = []; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.symbols && message.symbols.length) { + object.symbols = []; + for (var j = 0; j < message.symbols.length; ++j) + object.symbols[j] = $root.google.cloud.vision.v1p4beta1.Symbol.toObject(message.symbols[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Word to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Word + * @instance + * @returns {Object.} JSON object + */ + Word.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Word; + })(); + + v1p4beta1.Symbol = (function() { + + /** + * Properties of a Symbol. + * @memberof google.cloud.vision.v1p4beta1 + * @interface ISymbol + * @property {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null} [property] Symbol property + * @property {google.cloud.vision.v1p4beta1.IBoundingPoly|null} [boundingBox] Symbol boundingBox + * @property {string|null} [text] Symbol text + * @property {number|null} [confidence] Symbol confidence + */ + + /** + * Constructs a new Symbol. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a Symbol. + * @implements ISymbol + * @constructor + * @param {google.cloud.vision.v1p4beta1.ISymbol=} [properties] Properties to set + */ + function Symbol(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]]; + } + + /** + * Symbol property. + * @member {google.cloud.vision.v1p4beta1.TextAnnotation.ITextProperty|null|undefined} property + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @instance + */ + Symbol.prototype.property = null; + + /** + * Symbol boundingBox. + * @member {google.cloud.vision.v1p4beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @instance + */ + Symbol.prototype.boundingBox = null; + + /** + * Symbol text. + * @member {string} text + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @instance + */ + Symbol.prototype.text = ""; + + /** + * Symbol confidence. + * @member {number} confidence + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @instance + */ + Symbol.prototype.confidence = 0; + + /** + * Creates a new Symbol instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {google.cloud.vision.v1p4beta1.ISymbol=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.Symbol} Symbol instance + */ + Symbol.create = function create(properties) { + return new Symbol(properties); + }; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.vision.v1p4beta1.Symbol.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {google.cloud.vision.v1p4beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && message.hasOwnProperty("property")) + $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.vision.v1p4beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && message.hasOwnProperty("text")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.text); + if (message.confidence != null && message.hasOwnProperty("confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.Symbol.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {google.cloud.vision.v1p4beta1.ISymbol} message Symbol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Symbol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Symbol message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.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.vision.v1p4beta1.Symbol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.decode(reader, reader.uint32()); + break; + case 2: + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 3: + message.text = reader.string(); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Symbol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.Symbol} Symbol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Symbol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Symbol message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Symbol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.verify(message.property); + if (error) + return "property." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.vision.v1p4beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Symbol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.Symbol} Symbol + */ + Symbol.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.Symbol) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.Symbol(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Symbol.property: object expected"); + message.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.fromObject(object.property); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.Symbol.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.text != null) + message.text = String(object.text); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Symbol message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @static + * @param {google.cloud.vision.v1p4beta1.Symbol} message Symbol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Symbol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.property = null; + object.boundingBox = null; + object.text = ""; + object.confidence = 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.toObject(message.property, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.vision.v1p4beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Symbol to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.Symbol + * @instance + * @returns {Object.} JSON object + */ + Symbol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Symbol; + })(); + + v1p4beta1.WebDetection = (function() { + + /** + * Properties of a WebDetection. + * @memberof google.cloud.vision.v1p4beta1 + * @interface IWebDetection + * @property {Array.|null} [webEntities] WebDetection webEntities + * @property {Array.|null} [fullMatchingImages] WebDetection fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebDetection partialMatchingImages + * @property {Array.|null} [pagesWithMatchingImages] WebDetection pagesWithMatchingImages + * @property {Array.|null} [visuallySimilarImages] WebDetection visuallySimilarImages + * @property {Array.|null} [bestGuessLabels] WebDetection bestGuessLabels + */ + + /** + * Constructs a new WebDetection. + * @memberof google.cloud.vision.v1p4beta1 + * @classdesc Represents a WebDetection. + * @implements IWebDetection + * @constructor + * @param {google.cloud.vision.v1p4beta1.IWebDetection=} [properties] Properties to set + */ + function WebDetection(properties) { + this.webEntities = []; + this.fullMatchingImages = []; + this.partialMatchingImages = []; + this.pagesWithMatchingImages = []; + this.visuallySimilarImages = []; + this.bestGuessLabels = []; + 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]]; + } + + /** + * WebDetection webEntities. + * @member {Array.} webEntities + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @instance + */ + WebDetection.prototype.webEntities = $util.emptyArray; + + /** + * WebDetection fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @instance + */ + WebDetection.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebDetection partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @instance + */ + WebDetection.prototype.partialMatchingImages = $util.emptyArray; + + /** + * WebDetection pagesWithMatchingImages. + * @member {Array.} pagesWithMatchingImages + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @instance + */ + WebDetection.prototype.pagesWithMatchingImages = $util.emptyArray; + + /** + * WebDetection visuallySimilarImages. + * @member {Array.} visuallySimilarImages + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @instance + */ + WebDetection.prototype.visuallySimilarImages = $util.emptyArray; + + /** + * WebDetection bestGuessLabels. + * @member {Array.} bestGuessLabels + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @instance + */ + WebDetection.prototype.bestGuessLabels = $util.emptyArray; + + /** + * Creates a new WebDetection instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p4beta1.IWebDetection=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.WebDetection} WebDetection instance + */ + WebDetection.create = function create(properties) { + return new WebDetection(properties); + }; + + /** + * Encodes the specified WebDetection message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p4beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webEntities != null && message.webEntities.length) + for (var i = 0; i < message.webEntities.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.encode(message.webEntities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pagesWithMatchingImages != null && message.pagesWithMatchingImages.length) + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebPage.encode(message.pagesWithMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.visuallySimilarImages != null && message.visuallySimilarImages.length) + for (var i = 0; i < message.visuallySimilarImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.encode(message.visuallySimilarImages[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bestGuessLabels != null && message.bestGuessLabels.length) + for (var i = 0; i < message.bestGuessLabels.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.encode(message.bestGuessLabels[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebDetection message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p4beta1.IWebDetection} message WebDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebDetection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.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.vision.v1p4beta1.WebDetection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.webEntities && message.webEntities.length)) + message.webEntities = []; + message.webEntities.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.pagesWithMatchingImages && message.pagesWithMatchingImages.length)) + message.pagesWithMatchingImages = []; + message.pagesWithMatchingImages.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebPage.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.visuallySimilarImages && message.visuallySimilarImages.length)) + message.visuallySimilarImages = []; + message.visuallySimilarImages.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.bestGuessLabels && message.bestGuessLabels.length)) + message.bestGuessLabels = []; + message.bestGuessLabels.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebDetection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.WebDetection} WebDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebDetection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebDetection message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebDetection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webEntities != null && message.hasOwnProperty("webEntities")) { + if (!Array.isArray(message.webEntities)) + return "webEntities: array expected"; + for (var i = 0; i < message.webEntities.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.verify(message.webEntities[i]); + if (error) + return "webEntities." + error; + } + } + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + if (message.pagesWithMatchingImages != null && message.hasOwnProperty("pagesWithMatchingImages")) { + if (!Array.isArray(message.pagesWithMatchingImages)) + return "pagesWithMatchingImages: array expected"; + for (var i = 0; i < message.pagesWithMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebPage.verify(message.pagesWithMatchingImages[i]); + if (error) + return "pagesWithMatchingImages." + error; + } + } + if (message.visuallySimilarImages != null && message.hasOwnProperty("visuallySimilarImages")) { + if (!Array.isArray(message.visuallySimilarImages)) + return "visuallySimilarImages: array expected"; + for (var i = 0; i < message.visuallySimilarImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify(message.visuallySimilarImages[i]); + if (error) + return "visuallySimilarImages." + error; + } + } + if (message.bestGuessLabels != null && message.hasOwnProperty("bestGuessLabels")) { + if (!Array.isArray(message.bestGuessLabels)) + return "bestGuessLabels: array expected"; + for (var i = 0; i < message.bestGuessLabels.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.verify(message.bestGuessLabels[i]); + if (error) + return "bestGuessLabels." + error; + } + } + return null; + }; + + /** + * Creates a WebDetection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.WebDetection} WebDetection + */ + WebDetection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.WebDetection) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.WebDetection(); + if (object.webEntities) { + if (!Array.isArray(object.webEntities)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.webEntities: array expected"); + message.webEntities = []; + for (var i = 0; i < object.webEntities.length; ++i) { + if (typeof object.webEntities[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.webEntities: object expected"); + message.webEntities[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.fromObject(object.webEntities[i]); + } + } + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + if (object.pagesWithMatchingImages) { + if (!Array.isArray(object.pagesWithMatchingImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.pagesWithMatchingImages: array expected"); + message.pagesWithMatchingImages = []; + for (var i = 0; i < object.pagesWithMatchingImages.length; ++i) { + if (typeof object.pagesWithMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.pagesWithMatchingImages: object expected"); + message.pagesWithMatchingImages[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebPage.fromObject(object.pagesWithMatchingImages[i]); + } + } + if (object.visuallySimilarImages) { + if (!Array.isArray(object.visuallySimilarImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.visuallySimilarImages: array expected"); + message.visuallySimilarImages = []; + for (var i = 0; i < object.visuallySimilarImages.length; ++i) { + if (typeof object.visuallySimilarImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.visuallySimilarImages: object expected"); + message.visuallySimilarImages[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.fromObject(object.visuallySimilarImages[i]); + } + } + if (object.bestGuessLabels) { + if (!Array.isArray(object.bestGuessLabels)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.bestGuessLabels: array expected"); + message.bestGuessLabels = []; + for (var i = 0; i < object.bestGuessLabels.length; ++i) { + if (typeof object.bestGuessLabels[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.bestGuessLabels: object expected"); + message.bestGuessLabels[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.fromObject(object.bestGuessLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebDetection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection} message WebDetection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebDetection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.webEntities = []; + object.fullMatchingImages = []; + object.partialMatchingImages = []; + object.pagesWithMatchingImages = []; + object.visuallySimilarImages = []; + object.bestGuessLabels = []; + } + if (message.webEntities && message.webEntities.length) { + object.webEntities = []; + for (var j = 0; j < message.webEntities.length; ++j) + object.webEntities[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebEntity.toObject(message.webEntities[j], options); + } + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + if (message.pagesWithMatchingImages && message.pagesWithMatchingImages.length) { + object.pagesWithMatchingImages = []; + for (var j = 0; j < message.pagesWithMatchingImages.length; ++j) + object.pagesWithMatchingImages[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebPage.toObject(message.pagesWithMatchingImages[j], options); + } + if (message.visuallySimilarImages && message.visuallySimilarImages.length) { + object.visuallySimilarImages = []; + for (var j = 0; j < message.visuallySimilarImages.length; ++j) + object.visuallySimilarImages[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.toObject(message.visuallySimilarImages[j], options); + } + if (message.bestGuessLabels && message.bestGuessLabels.length) { + object.bestGuessLabels = []; + for (var j = 0; j < message.bestGuessLabels.length; ++j) + object.bestGuessLabels[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebLabel.toObject(message.bestGuessLabels[j], options); + } + return object; + }; + + /** + * Converts this WebDetection to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @instance + * @returns {Object.} JSON object + */ + WebDetection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + WebDetection.WebEntity = (function() { + + /** + * Properties of a WebEntity. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @interface IWebEntity + * @property {string|null} [entityId] WebEntity entityId + * @property {number|null} [score] WebEntity score + * @property {string|null} [description] WebEntity description + */ + + /** + * Constructs a new WebEntity. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @classdesc Represents a WebEntity. + * @implements IWebEntity + * @constructor + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebEntity=} [properties] Properties to set + */ + function WebEntity(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]]; + } + + /** + * WebEntity entityId. + * @member {string} entityId + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.entityId = ""; + + /** + * WebEntity score. + * @member {number} score + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.score = 0; + + /** + * WebEntity description. + * @member {string} description + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @instance + */ + WebEntity.prototype.description = ""; + + /** + * Creates a new WebEntity instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebEntity=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebEntity} WebEntity instance + */ + WebEntity.create = function create(properties) { + return new WebEntity(properties); + }; + + /** + * Encodes the specified WebEntity message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && message.hasOwnProperty("entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified WebEntity message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebEntity} message WebEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.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.vision.v1p4beta1.WebDetection.WebEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entityId = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebEntity} WebEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebEntity message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a WebEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebEntity} WebEntity + */ + WebEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.WebDetection.WebEntity) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.WebDetection.WebEntity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.score != null) + message.score = Number(object.score); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a WebEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.WebEntity} message WebEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.score = 0; + object.description = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this WebEntity to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebEntity + * @instance + * @returns {Object.} JSON object + */ + WebEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebEntity; + })(); + + WebDetection.WebImage = (function() { + + /** + * Properties of a WebImage. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @interface IWebImage + * @property {string|null} [url] WebImage url + * @property {number|null} [score] WebImage score + */ + + /** + * Constructs a new WebImage. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @classdesc Represents a WebImage. + * @implements IWebImage + * @constructor + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebImage=} [properties] Properties to set + */ + function WebImage(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]]; + } + + /** + * WebImage url. + * @member {string} url + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.url = ""; + + /** + * WebImage score. + * @member {number} score + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @instance + */ + WebImage.prototype.score = 0; + + /** + * Creates a new WebImage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebImage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebImage} WebImage instance + */ + WebImage.create = function create(properties) { + return new WebImage(properties); + }; + + /** + * Encodes the specified WebImage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified WebImage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebImage} message WebImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebImage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.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.vision.v1p4beta1.WebDetection.WebImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebImage} WebImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebImage message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebImage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a WebImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebImage} WebImage + */ + WebImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a WebImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.WebImage} message WebImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.score = 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this WebImage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebImage + * @instance + * @returns {Object.} JSON object + */ + WebImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebImage; + })(); + + WebDetection.WebLabel = (function() { + + /** + * Properties of a WebLabel. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @interface IWebLabel + * @property {string|null} [label] WebLabel label + * @property {string|null} [languageCode] WebLabel languageCode + */ + + /** + * Constructs a new WebLabel. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @classdesc Represents a WebLabel. + * @implements IWebLabel + * @constructor + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebLabel=} [properties] Properties to set + */ + function WebLabel(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]]; + } + + /** + * WebLabel label. + * @member {string} label + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.label = ""; + + /** + * WebLabel languageCode. + * @member {string} languageCode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @instance + */ + WebLabel.prototype.languageCode = ""; + + /** + * Creates a new WebLabel instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebLabel=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebLabel} WebLabel instance + */ + WebLabel.create = function create(properties) { + return new WebLabel(properties); + }; + + /** + * Encodes the specified WebLabel message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified WebLabel message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebLabel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebLabel} message WebLabel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebLabel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.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.vision.v1p4beta1.WebDetection.WebLabel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebLabel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebLabel} WebLabel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebLabel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebLabel message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebLabel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a WebLabel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebLabel} WebLabel + */ + WebLabel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.WebDetection.WebLabel) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.WebDetection.WebLabel(); + if (object.label != null) + message.label = String(object.label); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a WebLabel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.WebLabel} message WebLabel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebLabel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.languageCode = ""; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this WebLabel to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebLabel + * @instance + * @returns {Object.} JSON object + */ + WebLabel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebLabel; + })(); + + WebDetection.WebPage = (function() { + + /** + * Properties of a WebPage. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @interface IWebPage + * @property {string|null} [url] WebPage url + * @property {number|null} [score] WebPage score + * @property {string|null} [pageTitle] WebPage pageTitle + * @property {Array.|null} [fullMatchingImages] WebPage fullMatchingImages + * @property {Array.|null} [partialMatchingImages] WebPage partialMatchingImages + */ + + /** + * Constructs a new WebPage. + * @memberof google.cloud.vision.v1p4beta1.WebDetection + * @classdesc Represents a WebPage. + * @implements IWebPage + * @constructor + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebPage=} [properties] Properties to set + */ + function WebPage(properties) { + this.fullMatchingImages = []; + this.partialMatchingImages = []; + 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]]; + } + + /** + * WebPage url. + * @member {string} url + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.url = ""; + + /** + * WebPage score. + * @member {number} score + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.score = 0; + + /** + * WebPage pageTitle. + * @member {string} pageTitle + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.pageTitle = ""; + + /** + * WebPage fullMatchingImages. + * @member {Array.} fullMatchingImages + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.fullMatchingImages = $util.emptyArray; + + /** + * WebPage partialMatchingImages. + * @member {Array.} partialMatchingImages + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @instance + */ + WebPage.prototype.partialMatchingImages = $util.emptyArray; + + /** + * Creates a new WebPage instance using the specified properties. + * @function create + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebPage=} [properties] Properties to set + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebPage} WebPage instance + */ + WebPage.create = function create(properties) { + return new WebPage(properties); + }; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebPage.verify|verify} messages. + * @function encode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && message.hasOwnProperty("url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageTitle); + if (message.fullMatchingImages != null && message.fullMatchingImages.length) + for (var i = 0; i < message.fullMatchingImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.encode(message.fullMatchingImages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.partialMatchingImages != null && message.partialMatchingImages.length) + for (var i = 0; i < message.partialMatchingImages.length; ++i) + $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.encode(message.partialMatchingImages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link google.cloud.vision.v1p4beta1.WebDetection.WebPage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.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.vision.v1p4beta1.WebDetection.WebPage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.score = reader.float(); + break; + case 3: + message.pageTitle = reader.string(); + break; + case 4: + if (!(message.fullMatchingImages && message.fullMatchingImages.length)) + message.fullMatchingImages = []; + message.fullMatchingImages.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.partialMatchingImages && message.partialMatchingImages.length)) + message.partialMatchingImages = []; + message.partialMatchingImages.push($root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebPage message. + * @function verify + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebPage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + if (!$util.isString(message.pageTitle)) + return "pageTitle: string expected"; + if (message.fullMatchingImages != null && message.hasOwnProperty("fullMatchingImages")) { + if (!Array.isArray(message.fullMatchingImages)) + return "fullMatchingImages: array expected"; + for (var i = 0; i < message.fullMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify(message.fullMatchingImages[i]); + if (error) + return "fullMatchingImages." + error; + } + } + if (message.partialMatchingImages != null && message.hasOwnProperty("partialMatchingImages")) { + if (!Array.isArray(message.partialMatchingImages)) + return "partialMatchingImages: array expected"; + for (var i = 0; i < message.partialMatchingImages.length; ++i) { + var error = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.verify(message.partialMatchingImages[i]); + if (error) + return "partialMatchingImages." + error; + } + } + return null; + }; + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vision.v1p4beta1.WebDetection.WebPage} WebPage + */ + WebPage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vision.v1p4beta1.WebDetection.WebPage) + return object; + var message = new $root.google.cloud.vision.v1p4beta1.WebDetection.WebPage(); + if (object.url != null) + message.url = String(object.url); + if (object.score != null) + message.score = Number(object.score); + if (object.pageTitle != null) + message.pageTitle = String(object.pageTitle); + if (object.fullMatchingImages) { + if (!Array.isArray(object.fullMatchingImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.WebPage.fullMatchingImages: array expected"); + message.fullMatchingImages = []; + for (var i = 0; i < object.fullMatchingImages.length; ++i) { + if (typeof object.fullMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.WebPage.fullMatchingImages: object expected"); + message.fullMatchingImages[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.fromObject(object.fullMatchingImages[i]); + } + } + if (object.partialMatchingImages) { + if (!Array.isArray(object.partialMatchingImages)) + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.WebPage.partialMatchingImages: array expected"); + message.partialMatchingImages = []; + for (var i = 0; i < object.partialMatchingImages.length; ++i) { + if (typeof object.partialMatchingImages[i] !== "object") + throw TypeError(".google.cloud.vision.v1p4beta1.WebDetection.WebPage.partialMatchingImages: object expected"); + message.partialMatchingImages[i] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.fromObject(object.partialMatchingImages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @static + * @param {google.cloud.vision.v1p4beta1.WebDetection.WebPage} message WebPage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebPage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fullMatchingImages = []; + object.partialMatchingImages = []; + } + if (options.defaults) { + object.url = ""; + object.score = 0; + object.pageTitle = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.pageTitle != null && message.hasOwnProperty("pageTitle")) + object.pageTitle = message.pageTitle; + if (message.fullMatchingImages && message.fullMatchingImages.length) { + object.fullMatchingImages = []; + for (var j = 0; j < message.fullMatchingImages.length; ++j) + object.fullMatchingImages[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.toObject(message.fullMatchingImages[j], options); + } + if (message.partialMatchingImages && message.partialMatchingImages.length) { + object.partialMatchingImages = []; + for (var j = 0; j < message.partialMatchingImages.length; ++j) + object.partialMatchingImages[j] = $root.google.cloud.vision.v1p4beta1.WebDetection.WebImage.toObject(message.partialMatchingImages[j], options); + } + return object; + }; + + /** + * Converts this WebPage to JSON. + * @function toJSON + * @memberof google.cloud.vision.v1p4beta1.WebDetection.WebPage + * @instance + * @returns {Object.} JSON object + */ + WebPage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebPage; + })(); + + return WebDetection; + })(); + + return v1p4beta1; + })(); + + return vision; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.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.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + 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]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.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.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.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.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + 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; + })(); + + 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; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.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.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.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.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.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.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.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.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.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.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.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.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.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.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.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.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.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.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.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.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {string} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.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.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.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.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.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.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.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.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.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.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.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.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.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.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.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.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = false; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + 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(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.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.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = false; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @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 + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + 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 + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + 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; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.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.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + 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; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + 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; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + 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; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + 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; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + 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; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + 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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $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; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + 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; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.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.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.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; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + 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; + } + } + 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; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + 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; + } + } + 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"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + 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; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + 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; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {string} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.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.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + 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(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.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.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + 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(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.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.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + 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.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.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.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + 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.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + 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.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.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.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + case 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.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.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.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.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.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.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.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.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.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.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(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]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.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.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.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 Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.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.Duration(); + 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 Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.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 Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + 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 Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.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 Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(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 Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.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.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.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.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + 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.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(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]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.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.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(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]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.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.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(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]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.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.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(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]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.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.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(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]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.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.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(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]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.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.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(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]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.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.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(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]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.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.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && message.hasOwnProperty("metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && message.hasOwnProperty("done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && message.hasOwnProperty("response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.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.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.done = reader.bool(); + break; + case 4: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 5: + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(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]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.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.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(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]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.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.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; + case 1: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + 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; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + 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]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.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.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.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.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.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 CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(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]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.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.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.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 DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(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]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.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.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(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]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && message.hasOwnProperty("responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.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.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseType = reader.string(); + break; + case 2: + message.metadataType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationInfo; + })(); + + 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; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Color = (function() { + + /** + * Properties of a Color. + * @memberof google.type + * @interface IColor + * @property {number|null} [red] Color red + * @property {number|null} [green] Color green + * @property {number|null} [blue] Color blue + * @property {google.protobuf.IFloatValue|null} [alpha] Color alpha + */ + + /** + * Constructs a new Color. + * @memberof google.type + * @classdesc Represents a Color. + * @implements IColor + * @constructor + * @param {google.type.IColor=} [properties] Properties to set + */ + function Color(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]]; + } + + /** + * Color red. + * @member {number} red + * @memberof google.type.Color + * @instance + */ + Color.prototype.red = 0; + + /** + * Color green. + * @member {number} green + * @memberof google.type.Color + * @instance + */ + Color.prototype.green = 0; + + /** + * Color blue. + * @member {number} blue + * @memberof google.type.Color + * @instance + */ + Color.prototype.blue = 0; + + /** + * Color alpha. + * @member {google.protobuf.IFloatValue|null|undefined} alpha + * @memberof google.type.Color + * @instance + */ + Color.prototype.alpha = null; + + /** + * Creates a new Color instance using the specified properties. + * @function create + * @memberof google.type.Color + * @static + * @param {google.type.IColor=} [properties] Properties to set + * @returns {google.type.Color} Color instance + */ + Color.create = function create(properties) { + return new Color(properties); + }; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @function encode + * @memberof google.type.Color + * @static + * @param {google.type.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.red != null && message.hasOwnProperty("red")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.red); + if (message.green != null && message.hasOwnProperty("green")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.green); + if (message.blue != null && message.hasOwnProperty("blue")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.blue); + if (message.alpha != null && message.hasOwnProperty("alpha")) + $root.google.protobuf.FloatValue.encode(message.alpha, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.type.Color.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Color + * @static + * @param {google.type.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Color message from the specified reader or buffer. + * @function decode + * @memberof google.type.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.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.type.Color(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.red = reader.float(); + break; + case 2: + message.green = reader.float(); + break; + case 3: + message.blue = reader.float(); + break; + case 4: + message.alpha = $root.google.protobuf.FloatValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Color message. + * @function verify + * @memberof google.type.Color + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Color.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.red != null && message.hasOwnProperty("red")) + if (typeof message.red !== "number") + return "red: number expected"; + if (message.green != null && message.hasOwnProperty("green")) + if (typeof message.green !== "number") + return "green: number expected"; + if (message.blue != null && message.hasOwnProperty("blue")) + if (typeof message.blue !== "number") + return "blue: number expected"; + if (message.alpha != null && message.hasOwnProperty("alpha")) { + var error = $root.google.protobuf.FloatValue.verify(message.alpha); + if (error) + return "alpha." + error; + } + return null; + }; + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Color + * @static + * @param {Object.} object Plain object + * @returns {google.type.Color} Color + */ + Color.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Color) + return object; + var message = new $root.google.type.Color(); + if (object.red != null) + message.red = Number(object.red); + if (object.green != null) + message.green = Number(object.green); + if (object.blue != null) + message.blue = Number(object.blue); + if (object.alpha != null) { + if (typeof object.alpha !== "object") + throw TypeError(".google.type.Color.alpha: object expected"); + message.alpha = $root.google.protobuf.FloatValue.fromObject(object.alpha); + } + return message; + }; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Color + * @static + * @param {google.type.Color} message Color + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Color.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.red = 0; + object.green = 0; + object.blue = 0; + object.alpha = null; + } + if (message.red != null && message.hasOwnProperty("red")) + object.red = options.json && !isFinite(message.red) ? String(message.red) : message.red; + if (message.green != null && message.hasOwnProperty("green")) + object.green = options.json && !isFinite(message.green) ? String(message.green) : message.green; + if (message.blue != null && message.hasOwnProperty("blue")) + object.blue = options.json && !isFinite(message.blue) ? String(message.blue) : message.blue; + if (message.alpha != null && message.hasOwnProperty("alpha")) + object.alpha = $root.google.protobuf.FloatValue.toObject(message.alpha, options); + return object; + }; + + /** + * Converts this Color to JSON. + * @function toJSON + * @memberof google.type.Color + * @instance + * @returns {Object.} JSON object + */ + Color.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Color; + })(); + + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(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]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && message.hasOwnProperty("latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && message.hasOwnProperty("longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.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.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latitude = reader.double(); + break; + case 2: + message.longitude = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) + return object; + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LatLng + * @static + * @param {google.type.LatLng} message LatLng + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLng.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this LatLng to JSON. + * @function toJSON + * @memberof google.type.LatLng + * @instance + * @returns {Object.} JSON object + */ + LatLng.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LatLng; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/synth.metadata b/synth.metadata index 984250d9..23cb6ba5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-09-14T11:29:38.380853Z", + "updateTime": "2019-09-20T11:30:18.499019Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.2", - "dockerImage": "googleapis/artman@sha256:0e6f3a668cd68afc768ecbe08817cf6e56a0e64fcbdb1c58c3b97492d12418a1" + "version": "0.36.3", + "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6b2ba2ae3124c22ecb56af7102c78110b8576671", - "internalRef": "268974829" + "sha": "44e588d97e7497dff01107d39b6a19062f9a4ffa", + "internalRef": "270200097" } }, {